-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEndGameState.cpp
More file actions
40 lines (32 loc) · 789 Bytes
/
EndGameState.cpp
File metadata and controls
40 lines (32 loc) · 789 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
#include "EndGameState.h"
EndGameState::EndGameState(Board* board, IGameStateMachine* stateMachine) : GameBaseState(board, stateMachine, GameStateType::EndGame)
{
_font.loadFromFile(FONT_PATH);
_winnerText.setFont(_font);
_winnerText.setCharacterSize(30);
_winnerText.setFillColor(sf::Color::White);
_winnerText.setPosition(sf::Vector2f(500.f, 350.f));
UpdateWinnerText();
}
void EndGameState::Initialize()
{
}
void EndGameState::EnterState()
{
LogEnter();
UpdateWinnerText();
}
void EndGameState::UpdateState()
{
}
void EndGameState::LeaveState()
{
}
void EndGameState::Draw(Window* window)
{
window->Draw(_winnerText);
}
void EndGameState::UpdateWinnerText()
{
_winnerText.setString(WINNER_TEXT_PLACEHOLDER + PLAYER_ORDER_TYPE_STRINGS[(char)GameBoard->GetWinner()]);
}