home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / CTECHAPP.ZIP / SIMULATN.ZIP / CREATURE.HPP < prev    next >
C/C++ Source or Header  |  1990-02-09  |  1KB  |  45 lines

  1. //  Header:     Creature
  2. //  Version:    2.00
  3. //
  4. //  Language:   C++ 2.0
  5. //  Environ:    MS-DOS, Zortech C++ v2.0x
  6. //
  7. //  Purpose:    SIMECO Creature class definition
  8. //
  9. //  Written by: Scott Robert Ladd
  10.  
  11. #if !defined(__CREATURE_HPP)
  12. #define __CREATURE_HPP 1
  13.  
  14. #include "WorkList.hpp"
  15.  
  16. class Creature
  17.     {
  18.     protected:
  19.         unsigned char Color;     // this Creature's color
  20.  
  21.         int Energy;              // current energy level
  22.         int Age;                 // current age
  23.         int AgeRep;              // age since last reproduction
  24.  
  25.         int PosX, PosY;          // horizontal position on screen
  26.  
  27.     public:
  28.         // public list of all creatures
  29.         static WorkList CList;   // list of all creatures in existence
  30.  
  31.         // constructor
  32.         Creature(unsigned char c, int e, int x, int y);
  33.  
  34.         // ask creature to perform an action
  35.         virtual int Move() = 0;
  36.  
  37.         // tell creature to draw itself
  38.         virtual void Draw() = 0;
  39.  
  40.         // tell creature to erase itself
  41.         virtual void Erase() = 0;
  42.     };
  43.  
  44. #endif
  45.