-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTicTacToeGame.h
51 lines (40 loc) · 1.11 KB
/
TicTacToeGame.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef TICTACTOEGAME_H
#define TICTACTOEGAME_H
#include <Arduino.h>
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include "Debug.h"
#include "Keypad.h"
#include "TicTacToeClasses.h"
#include "TicTacToeArm.h"
#include "TicTacToeBoard.h"
#include "TicTacToeCell.h"
#include "TicTacToeUI.h"
#include "TicTacToePlayer.h"
#include "TicTacToePlayerAI.h"
#include "TicTacToePlayerHuman.h"
#include "TicTacToeGameData.h"
class TicTacToeGame {
public:
TicTacToeGame();
void setup(LiquidCrystal_I2C* lcd, TicTacToeArm* arm, Keypad* keypad_primary, Keypad* keypad_secondary);
void loop();
void interruptMenu(Keypad* keypad);
void refreshScreen();
private:
void resetGame();
enum gameState { STATE_GETPLAYERS, STATE_PLAYING, STATE_INTERRUPTMENU };
enum gameType { TYPE_UNSET, TYPE_SINGLEPLAYER, TYPE_TWOPLAYER, TYPE_AI };
gameState state = STATE_GETPLAYERS;
gameType type = TYPE_UNSET;
TicTacToeBoard* board;
Keypad* keypad[2];
TicTacToeGameData* scores;
int lastPlayer = -1;
TicTacToeUI ui;
TicTacToeArm* arm;
TicTacToePlayer* player[2];
LiquidCrystal_I2C* lcd;
};
#endif