heuristicas começando a implementar ...
[xYpjg3TdSw.git] / Controller.h
blob3e25699bf395fd182c0763b61b24fdbc8924aca4
1 #ifndef __IA_CONTROLLER_H__
2 #define __IA_CONTROLLER_H__
4 #include <cstdio>
6 class Window;
7 class Game;
9 class Controller
11 public:
12 Controller(Game *game);
13 ~Controller();
15 void click(int x, int y);
17 void set_minimax_depth(int minimaxDepth);
18 void set_first_move(int firstMove);
19 void set_computer_color(int computerColor);
20 void set_window(Window *window);
22 void play();
23 void stop();
24 void undo();
25 void redo();
26 void load(FILE *in);
27 /* called after render scene
28 * checks if its the computer turn to play
30 void after_display();
32 bool is_empty(int x, int y);
33 int piece(int x, int y);
34 bool is_highlighted(int x, int y);
35 int highlight(int x, int y);
37 private:
38 void clear_highlight();
39 bool can_highlight(int x, int y);
40 void update_all();
42 Window *_window;
43 bool _is_highlighted[8][8], _is_empty[8][8], _has_highlight, _is_playing;
44 char _highlight[8][8], _piece[8][8];
45 int _last_click_x, _last_click_y;
46 Game *_game;
49 #endif