-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.h
48 lines (36 loc) · 1017 Bytes
/
game.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
#ifndef _GAME_H_
#define _GAME_H_
#include <Adafruit_GFX.h> // Core graphics library
#include <SPI.h> // Library for SPI mode
#include <Adafruit_ILI9341.h> // Controller chip library
#include "TouchScreen.h" //Library for TouchScreen
// Game class, used for tracking current game state
/*
State codes:
0 - main menu
1 - setting up ships
2 - playing turn
3 - end game screen
*/
class Game{
private:
int _state;
int _mode;
int _player_isalive;
public:
// Object constructor
Game(int user_state, int game_mode);
// Returns the game mode
int get_game_mode();
// Checks the game mode (when at main menu)
int update_game_mode(Adafruit_ILI9341 display, TSPoint point);
// Returns the current game state
int get_state();
// Updates the current game state
void update_state(int new_state);
// Updates the player alive status
void update_is_alive(int new_status);
// Returns player alive status
int get_is_alive();
};
#endif