home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_10 / 1010111a < prev    next >
Text File  |  1992-08-10  |  1KB  |  51 lines

  1. #ifndef GAME_H
  2. #define GAME_H
  3.  
  4. class game_piece {    
  5.  
  6.    public:
  7.       virtual void position ();     // notice the keyword virtual 
  8.       virtual void move ();         // preceeding these member functions.
  9.    private:
  10.       int            x_coord;
  11.       int            y_coord;
  12. };
  13.  
  14. class pawn : public game_piece {
  15.  
  16.    public: 
  17.       pawn ();
  18.       ~pawn ();
  19.       void position ();          // derived class implementations of
  20.       void move ();              // base class virtual functions.
  21. };
  22.  
  23. class bishop : public game_piece {
  24.  
  25.    public: 
  26.       bishop ();
  27.       ~bishop ();
  28.       void position ();          // derived class implementations of
  29.       void move ();              // base class virtual functions.
  30. };
  31.  
  32. class rook : public game_piece {
  33.  
  34.    public: 
  35.       rook ();
  36.       ~rook ();
  37.       void position ();          // derived class implementations of
  38.       void move ();              // base class virtual functions.
  39. };
  40.  
  41. class king : public game_piece {
  42.  
  43.    public: 
  44.       king ();
  45.       ~king ();
  46.       void position ();          // derived class implementations of
  47.       void move ();              // base class virtual functions.
  48. };
  49.  
  50. #endif   // GAME_H 
  51.