1 #ifndef _keeper_h 2 #define _keeper_h 3 4 #ifndef _real_h 5 # include "real.h" 6 #endif 7 8 class Ball; 9 class Wall; 10 11 12 class Keeper { 13 public: 14 Keeper(const Real &size_int, const Real &frame_in, ColorId frame_col, ColorId table_col); 15 virtual ~Keeper(); 16 17 virtual void Draw() = 0; 18 virtual void GameWasReset(); 19 20 void TakeOffBoard(Ball *b); 21 22 static int IsOffBoard(Ball *b); 23 static Ball *GetBack(Ball *b); 24 25 protected: 26 virtual void PlaceOffBoard(Ball *b) = 0; 27 28 int off_count; 29 ColorId frame_col; 30 ColorId table_col; 31 Real size; // Hoehe oder Breite 32 Real frame; // Breite des Rahmens 33 }; 34 35 36 #define UPPER_FLAG 0x01 37 #define CLOSE_LEFT 0x02 38 #define CLOSE_RIGHT 0x04 39 40 class LineKeeper : public Keeper { 41 public: 42 LineKeeper(const Real &height, const Real &frame, ColorId frame_col, ColorId table_col=0, int mode=CLOSE_LEFT); 43 virtual ~LineKeeper(); 44 virtual void Draw(); 45 46 protected: 47 virtual void PlaceOffBoard(Ball *b); 48 int mode; 49 50 Wall *wall1,*wall2; 51 }; 52 53 54 #define LEFT_FLAG 0x01 55 #define CLOSE_TOP 0x02 56 #define CLOSE_BOT 0x04 57 58 class StackKeeper : public Keeper { 59 public: 60 StackKeeper(const Real &width, const Real &frame, ColorId frame_col, ColorId table_col=0, int mode=CLOSE_BOT); 61 virtual ~StackKeeper(); 62 virtual void Draw(); 63 64 protected: 65 virtual void PlaceOffBoard(Ball *b); 66 int mode; 67 68 Wall *wall1, *wall2; 69 }; 70 71 #endif 72