![]() |
Dragonfly 2.2
A text-based game engine
|
00001 /// 00002 /// A 2-d (x,y) position 00003 /// 00004 00005 #ifndef __POSITION_H__ 00006 #define __POSITION_H__ 00007 00008 class Position { 00009 00010 protected: 00011 int x; ///< Horizontal coordinate in 2d world. 00012 int y; ///< Vertical coordinate in 2d world. 00013 00014 public: 00015 00016 /// Create object at 2-d location (x,y). 00017 Position(int init_x, int init_y); 00018 00019 /// Default 2-d (x,y) location is (0,0). 00020 Position(); 00021 00022 ~Position(); 00023 00024 int getX(); ///< Get horizontal coordinate. 00025 void setX(int new_x); ///< Set horizontal coordinate. 00026 int getY(); ///< Get vertical coordinate. 00027 void setY(int new_y); ///< Set vertical coordinate. 00028 void setXY(int new_x, int new_y); ///< Set horizontal & vertical coordinate. 00029 }; 00030 00031 #endif //__POSITION_H__ 00032