-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFirstPlayerState.cpp
More file actions
43 lines (35 loc) · 861 Bytes
/
FirstPlayerState.cpp
File metadata and controls
43 lines (35 loc) · 861 Bytes
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
#include "FirstPlayerState.h"
FirstPlayerState::FirstPlayerState(Board* board, IGameStateMachine* stateMachine) : GameBaseState(board, stateMachine, GameStateType::FirstPlayer)
{
_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);
}
void FirstPlayerState::Initialize()
{
}
void FirstPlayerState::EnterState()
{
LogEnter();
Dice::Roll();
PlayerFirst->OnTurnEnter();
}
void FirstPlayerState::UpdateState()
{
PlayerFirst->OnUpdate();
}
void FirstPlayerState::LeaveState()
{
GameBoard->ResetTurns();
PlayerFirst->OnTurnExit();
}
void FirstPlayerState::Draw(Window* window)
{
GameBoard->Draw(window);
PlayerFirst->Draw(window);
window->Draw(_turnText);
Dice::Draw(window);
}