]> Shamusworld >> Repos - architektonas/blobdiff - src/object.cpp
In the middle of refactoring objects for loading/saving.
[architektonas] / src / object.cpp
index ab95c0ea16fb5a35cf56af5074671b17cf8377b2..8f9377bf7345624c61acffb6b9de11735a4ec656 100644 (file)
@@ -32,77 +32,105 @@ Object::Object(): position(Vector(0, 0)), parent(0), state(OSInactive), oldState
 {
 }
 
+
 Object::Object(Vector v,  Object * passedInParent/*= 0*/): position(v), parent(passedInParent),
        state(OSInactive), oldState(OSInactive), needUpdate(false), attachedDimension(0)
 {
 }
 
+
 Object::~Object()
 {
 }
 
+
 /*virtual*/ void Object::Draw(Painter *)
 {
 }
 
+
 /*virtual*/ Vector Object::Center(void)
 {
        return Vector();
 }
 
+
 /*virtual*/ bool Object::Collided(Vector)
 {
        return false;
 }
 
+
 /*virtual*/ void Object::PointerMoved(Vector)
 {
 }
 
+
 /*virtual*/ void Object::PointerReleased(void)
 {
 }
 
+
 /*virtual*/ bool Object::NeedsUpdate(void)
 {
        return needUpdate;
 }
 
+
 // This is intended to be overridden by the Container class, for object morphing
 /*virtual*/ void Object::Transmute(Object *, Object *)
 {
 }
 
+
 /*virtual*/ Object * Object::GetParent(void)
 {
        return parent;
 }
 
+
 /*virtual*/ void Object::Add(Object *)
 {
 }
 
+
 // This returns a pointer to the point passed in, if it coincides. Otherwise returns NULL.
 /*virtual*/ Vector * Object::GetPointAt(Vector)
 {
        return 0;
 }
 
+
+// This is meant for writing object data to a file.
+/*virtual*/ void Object::Enumerate(FILE *)
+{
+}
+
+
+/*virtual*/ Object * Object::Copy(void)
+{
+       return new Object(position, parent);
+}
+
+
 ObjectState Object::GetState(void)
 {
        return state;
 }
 
+
 void Object::Reparent(Object * newParent)
 {
        parent = newParent;
 }
 
+
 Dimension * Object::GetAttachedDimension(void)
 {
        return attachedDimension;
 }
 
+
 // Class methods...
 
 void Object::SetFixedAngle(bool state/*= true*/)
@@ -110,31 +138,37 @@ void Object::SetFixedAngle(bool state/*= true*/)
        fixedAngle = state;
 }
 
+
 void Object::SetFixedLength(bool state/*= true*/)
 {
        fixedLength = state;
 }
 
+
 void Object::SetFont(QFont * f)
 {
        font = f;
 }
 
+
 void Object::SetViewportHeight(int height)
 {
        viewportHeight = height;
 }
 
+
 void Object::SetDeleteActive(bool state/*= true*/)
 {
        deleteActive = state;
 }
 
+
 void Object::SetDimensionActive(bool state/*= true*/)
 {
        dimensionActive = state;
 }
 
+
 void Object::SetSnapMode(bool state/*= true*/)
 {
        snapToGrid = state;