-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.hpp
47 lines (38 loc) · 964 Bytes
/
game.hpp
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
//
// Created by 200458668 on 11/12/2020.
//
#ifndef DIEROLLERGAME_GAME_HPP
#define DIEROLLERGAME_GAME_HPP
#include <memory>
#include <string>
#include <iostream>
#include "statemachine.hpp"
#include "dice.hpp"
#include "player.hpp"
enum class PlayerConfig {PLAYER2, CPU, PLAYER_INVALID};
enum class GameConfig{ DICE, RANDOM, INVALID, QUIT };
enum DieConfig{ SIX = 6, TEN = 10, TWENTY =20, DIE_INVALID = -1};
enum DiceConfig{ ONE = 1, TWO = 2, THREE = 3, DICE_INVALID = -1};
static int currentRound = 0;
struct {
StateMachine machine;
std::string input;
int _totalSides;
PlayerConfig _playerConfig;
GameConfig _gameConfig;
DieConfig _dieConfig;
DiceConfig _diceConfig;
Player p1;
Player p2;
bool nextRound;
bool playGame;
} typedef GameData;
typedef std::shared_ptr<GameData> GameDataRef;
class Game {
public:
Game();
void Run();
private:
GameDataRef _data = std::make_shared<GameData>();
};
#endif