Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

mgobject.cc

Go to the documentation of this file.
00001 
00002 #include "magic/mgobject.h"
00003 
00004 BEGIN_NAMESPACE (MagiC);
00005 
00006 decl_module (gobject);
00007 
00008 void Rect::operator= (const Rect& other) {
00009     memcpy (this, &other, sizeof(Rect));
00010 }
00011 
00012 void Rect::moveTo (const Coord2D& pos) {
00013     Coord2D offset (pos.x-mCorner1.x, pos.y-mCorner1.y);
00014     moveBy (offset);
00015 }
00016 
00017 void Rect::moveBy (const Coord2D& offset) {
00018     mCorner1 += offset;
00019     mCorner2 += offset;
00020 }
00021 
00022 bool Rect::touches (const Rect& other) const {
00023     /*
00024     if (is_inside (other.x0, other.y0)) return 1;
00025     if (is_inside (other.x0, other.y1)) return 1;
00026     if (is_inside (other.x1, other.y1)) return 1;
00027     if (is_inside (other.x1, other.y0)) return 1;
00028     if (other.is_inside (x0, y0))   return 1;
00029     if (other.is_inside (x0, y1))   return 1;
00030     if (other.is_inside (x1, y1))   return 1;
00031     if (other.is_inside (x1, y0))   return 1;
00032     */
00033     return false;
00034 }
00035 
00036 END_NAMESPACE;
00037 

Generated on Thu Feb 10 20:06:41 2005 for LibMagiC by doxygen1.2.18