-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameState.h
More file actions
80 lines (64 loc) · 1.76 KB
/
GameState.h
File metadata and controls
80 lines (64 loc) · 1.76 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#pragma once
#define GAMESTATE_H
#include "OptionsState.h"
#include "PauseMenu.h"
class GameState :
public State
{
private:
PauseMenu* pmenu;
sf::Font font;
int total_players;
short player_turn;
short player_to_go;
float dt_freeze;
Player* actualPlayer;
sf::Music* menuMusic;
//objects
Dice* dice;
Dice* dice2;
Bank* bank;
ScoreBoard* score_board;
CardDeck* card_deck;
TradeComponent* trade_component;
//players
GamePlayers* players;
//board
BoardSpaces* boardSpaces;
//buttons & text
GameButtons* gameButtons;
OperationsComponent* operations;
SpaceActionHandler* spaceActionHandler;
//background
sf::Texture backgroundTexture;
sf::RectangleShape background;
//DialogBox
DialogBoxes* dialogboxes;
//Init functions
void initVariables(unsigned short totalPlayers, sf::Font& font);
void initBackground();
void initMusic();
void initKeyBinds();
void initBoardComponents();
void initPauseMenu();
public:
GameState(sf::RenderWindow* window, std::map<std::string, int>* supportedKeys, std::stack<State*>* states,
unsigned short totalPlayers, sf::Font& font, sf::Event* sfEvent, sf::Music* music);
virtual ~GameState();
//Functions
void updateButtons(const float& dt);
void updatePauseMenuButtons();
void updateDice(const float& dt);
void moveCheck(const float& dt);
void updateInput(const float& dt);
void updatePlayerInput(const float& dt);
void actionFreezeUpdate(const float& dt);
void update(const float& dt);
//Player
void playerTurn(const float& dt);
void playerMove(const float& dt);
void nextPlayer();
void renderButtons(sf::RenderTarget* target);
void renderTextScore(sf::RenderTarget* target);
void render(sf::RenderTarget* target = nullptr);
};