AI
[crack-attack.git] / src / ComputerPlayer.h
blob2edf8f1381b3e83b8666146c58951813a07fcc9a
1 #ifndef COMP_PLAY_H
2 #define COMP_PLAY_H
4 using namespace std;
6 #include <glib.h>
8 #include "Score.h"
9 #include "GarbageGenerator.h"
10 #include "ComputerPlayerAI.h"
12 class GarbageQueueElement;
13 class ComputerPlayerAI;
15 class GarbageQueue {
16 public:
17 GarbageQueue();
18 ~GarbageQueue();
20 void add ( int height, int width, int flavor );
21 void add ( GarbageQueueElement *element );
23 int height ( );
25 GSList *garbage ( );
26 GSList *specialGarbage ( );
28 void reset();
30 void sendToGenerator ( );
31 private:
32 GSList *garbage_queue;
33 int cached_height;
36 /* static */ class ComputerPlayer {
37 private:
38 static bool lost;
39 static GarbageQueue *queue;
40 static ComputerPlayerAI *ai;
42 static void determineLoss ( );
44 public:
45 static void gameStart ( );
46 static void timeStep ( );
47 static int gameFinish ( );
49 static void addGarbage ( int height, int width, int flavor ) {
50 if (queue)
51 queue->add(height, width, flavor);
55 #endif