Game.hpp
Go to the documentation of this file.
1 // This code is based on Sabberstone project.
2 // Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva
3 // Hearthstone++ is hearthstone simulator using C++ with reinforcement learning.
4 // Copyright (c) 2019 Chris Ohk, Youngjoong Kim, SeungHyun Jeon
5 
6 #ifndef ROSETTASTONE_GAME_HPP
7 #define ROSETTASTONE_GAME_HPP
8 
12 
13 namespace RosettaStone
14 {
21 class Game
22 {
23  public:
25  Game() = delete;
26 
29  explicit Game(GameConfig& gameConfig);
30 
32  virtual ~Game() = default;
33 
35  Game(const Game&) = delete;
36 
38  Game(Game&&) = delete;
39 
41  Game& operator=(const Game&) = delete;
42 
44  Game& operator=(Game&&) = delete;
45 
48  Player& GetPlayer1();
49 
52  Player& GetPlayer2();
53 
56  Player& GetCurrentPlayer() const;
57 
60  Player& GetOpponentPlayer() const;
61 
64  std::size_t GetNextID();
65 
68  std::size_t GetNextOOP();
69 
71  virtual void BeginFirst();
72 
74  virtual void BeginShuffle();
75 
77  virtual void BeginDraw();
78 
80  virtual void BeginMulligan();
81 
83  virtual void MainBegin();
84 
86  virtual void MainReady();
87 
89  virtual void MainStartTriggers();
90 
92  virtual void MainResource();
93 
95  virtual void MainDraw();
96 
98  virtual void MainStart();
99 
101  virtual void MainEnd();
102 
104  virtual void MainCleanUp();
105 
107  virtual void MainNext();
108 
110  virtual void FinalWrapUp();
111 
113  virtual void FinalGameOver();
114 
116  void StartGame();
117 
119 
122 
123  private:
124  GameConfig m_gameConfig;
125 
126  std::array<Player, 2> m_players;
127  std::size_t m_turn = 0;
128 
129  std::size_t m_entityID = 0;
130  std::size_t m_oopIndex = 0;
131 
132  Player* m_firstPlayer = nullptr;
133  Player* m_currentPlayer = nullptr;
134 };
135 } // namespace RosettaStone
136 
137 #endif // ROSETTASTONE_GAME_HPP
virtual void MainDraw()
Part of the game state.
virtual void MainStartTriggers()
Part of the game state.
Step nextStep
Definition: Game.hpp:121
virtual void FinalWrapUp()
Part of the game state.
State state
Definition: Game.hpp:118
virtual void FinalGameOver()
Part of the game state.
virtual void MainBegin()
Part of the game state.
virtual void MainEnd()
Part of the game state.
Game class.
Definition: Game.hpp:21
std::size_t GetNextOOP()
Player & GetOpponentPlayer() const
virtual void BeginFirst()
Part of the game state.
Player & GetCurrentPlayer() const
virtual void BeginShuffle()
Part of the game state.
Game & operator=(const Game &)=delete
Deleted copy assignment operator.
void StartGame()
Starts the game.
Player & GetPlayer2()
virtual void MainNext()
Part of the game state.
virtual void MainStart()
Part of the game state.
Game()=delete
Deleted default constructor.
Step step
Definition: Game.hpp:120
GameConfig struct.
Definition: GameConfig.hpp:21
virtual void MainReady()
Part of the game state.
virtual void MainResource()
Part of the game state.
virtual void MainCleanUp()
Part of the game state.
virtual void BeginDraw()
Part of the game state.
virtual ~Game()=default
Default destructor.
std::size_t GetNextID()
Player class.
Definition: Player.hpp:33
virtual void BeginMulligan()
Part of the game state.
Definition: AccountInfo.hpp:14
Player & GetPlayer1()