-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFirstPlayerEndState.cpp
More file actions
52 lines (41 loc) · 1.09 KB
/
FirstPlayerEndState.cpp
File metadata and controls
52 lines (41 loc) · 1.09 KB
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
52
#include "FirstPlayerEndState.h"
FirstPlayerEndState::FirstPlayerEndState(Board* board, IGameStateMachine* stateMachine) : GameBaseState(board, stateMachine, GameStateType::FirstPlayerEnd)
{
_font.loadFromFile(FONT_PATH);
_turnText.setFont(_font);
_turnText.setCharacterSize(30);
_turnText.setFillColor(sf::Color::Black);
_turnText.setPosition(sf::Vector2f(550.f, 10.f));
_turnText.setString(_turnTextString);
_hintText.setFont(_font);
_hintText.setCharacterSize(30);
_hintText.setFillColor(sf::Color::White);
_hintText.setPosition(sf::Vector2f(380.f, 720.f));
_hintText.setString(_hintTextString);
}
void FirstPlayerEndState::Initialize()
{
}
void FirstPlayerEndState::EnterState()
{
LogEnter();
Dice::Roll();
PlayerFirst->OnEndTurnEnter();
}
void FirstPlayerEndState::UpdateState()
{
PlayerFirst->OnEndUpdate();
}
void FirstPlayerEndState::LeaveState()
{
GameBoard->ResetTurns();
PlayerFirst->OnTurnExit();
}
void FirstPlayerEndState::Draw(Window* window)
{
GameBoard->Draw(window);
PlayerFirst->Draw(window);
window->Draw(_turnText);
window->Draw(_hintText);
Dice::Draw(window);
}