X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fobject.cpp;h=09d52bf3357b02165410e82e4200877421eddb7e;hb=565c33c91ea355528145ba94b31b2e44309d0834;hp=dd80007d1998cc4c4772848c35580a53fe2f9859;hpb=a42277d4d950d32459b16b3ec8ee8287c9c0afab;p=architektonas diff --git a/src/object.cpp b/src/object.cpp index dd80007..09d52bf 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -145,22 +145,24 @@ printf("Object: Destroyed!\n"); // them here. :-) /*virtual*/ void Object::Connect(Object * obj, double parameter) { - connected.push_back(Connection(obj, parameter)); + // Check to see if this connection is already in our list... + Connection c(obj, parameter); + std::vector::iterator i; + + for(i=connected.begin(); i!=connected.end(); i++) + { + // Bail out if this connection is already present... + if (*i == c) + return; + } + + // Connection is a new one, add it in... + connected.push_back(c); } /*virtual*/ void Object::Disconnect(Object * obj, double parameter) { -#if 0 - for(uint i=0; i::iterator i; for(i=connected.begin(); i!=connected.end(); i++) @@ -171,25 +173,11 @@ printf("Object: Destroyed!\n"); return; } } -#endif } /*virtual*/ void Object::DisconnectAll(Object * obj) { -#if 0 - // According the std::vector docs, only items at position i and beyond are - // invalidated, everything before i is still valid. So we use that here. - for(uint i=0; i::iterator i; for(i=connected.begin(); i!=connected.end(); ) @@ -199,7 +187,6 @@ printf("Object: Destroyed!\n"); else i++; } -#endif } @@ -224,19 +211,30 @@ printf("Object: Destroyed!\n"); } -/*virtual*/ void Object::Rotate(Vector, double) +/*virtual*/ void Object::Rotate(Point, double) +{ +} + + +/*virtual*/ void Object::Scale(Point, double) +{ +} + + +/*virtual*/ void Object::Mirror(Point, Point) { } -/*virtual*/ void Object::Scale(Vector, double) +/*virtual*/ void Object::Save(void) { + oldPosition = position; } -/*virtual*/ Object * Object::Mirror(Vector, Vector) +/*virtual*/ void Object::Restore(void) { - return NULL; + position = oldPosition; }