1 /*
2  * ComputerPlayerAI.h
3  * Andrew Sayman - 3/27/05
4  *
5  * Copyright (C) 2005  Andrew Sayman
6  * Copyright (C) 2005  Kevin Webb
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2
11  * of the License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21  */
22 
23 #ifndef cpai_h_
24 #define cpai_h_
25 
26 #include "GarbageQueue.h"
27 
28 class GarbageQueue;
29 
30 class ComputerPlayerAI {
31 private:
32   int last_time;
33   int last_shatter_height;
34 
35 protected:
36   enum AI_STATE { AI_WAITING, AI_SHATTERING } state;
37   GarbageQueue *queue;
38 
39   virtual int baseSteps();
40   virtual int stateSteps();
41   virtual int garbageShatterDelay ( );
42 
43   virtual void shatter();
44 
45 public:
46 
47   ComputerPlayerAI();
~ComputerPlayerAI()48   virtual ~ComputerPlayerAI(){}
49 
50   int alarm ( );
51   void resetAlarm ( );
52   GarbageQueue *garbageQueue ( );
53   virtual GarbageQueue *garbageAmount ( );
54 
55   virtual bool determineLoss ( );
56   virtual int lossHeight();
57 };
58 
59 class EasyAI :public ComputerPlayerAI {
60 public:
EasyAI()61   EasyAI() { }
~EasyAI()62   virtual ~EasyAI(){}
63 
64   virtual int lossHeight();
65 protected:
66   virtual int baseSteps();
67 };
68 
69 class MediumAI :public ComputerPlayerAI {
70 public:
MediumAI()71   MediumAI(){}
~MediumAI()72   virtual ~MediumAI(){}
73 
74   virtual int lossHeight();
75 protected:
76   virtual int baseSteps();
77 };
78 
79 class HardAI :public ComputerPlayerAI {
80 public:
HardAI()81   HardAI(){}
~HardAI()82   virtual ~HardAI(){}
83 
84   virtual int lossHeight();
85 protected:
86   virtual int baseSteps();
87 
88 };
89 
90 #endif
91