home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / thx / demos / skyscrap / build / object.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-13  |  765 b   |  42 lines

  1. #ifndef __object_h
  2. #define __object_h
  3.  
  4. #include <theatrix.h>
  5.  
  6. struct point
  7. {
  8.   int x,y;
  9. };
  10.  
  11. struct rect
  12. {
  13.   int l,t,r,b,w,h; // left,top,right,bottom,width,height
  14. };
  15.  
  16. //--------------------------------------
  17. // Object
  18. // the base class for any graphical object
  19. // maintains a location on the screen
  20. // draws itself
  21. //--------------------------------------
  22. class Object : public Performer
  23. {
  24.   // data
  25.   private:
  26.   protected:
  27.     point loc;
  28.     int width, height;
  29.   public:
  30.  
  31.   // functions
  32.   private:
  33.   protected:
  34.   public:
  35.     Object() : Performer() {};
  36.     virtual void OnDraw(void)=0;
  37.     void SetXY( int X, int Y )  { loc.x=X, loc.y=Y;    }
  38.     point GetPosition(void)     { return loc;          }
  39. };
  40.  
  41. #endif //__object_h
  42.