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