-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathState.h
More file actions
52 lines (42 loc) · 1.16 KB
/
State.h
File metadata and controls
52 lines (42 loc) · 1.16 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
#pragma once
#define STATE_H
#include "GamePlayers.h"
class State
{
protected:
std::stack<State*>* states;
sf::RenderWindow* window;
sf::Music* music;
std::map<std::string, int>* supportedKeys;
std::map<std::string, int> keyBinds;
sf::Event* sfEvent;
bool quit;
bool paused;
float keytime;
float keytimeMax;
sf::Vector2i mousePosScreen;
sf::Vector2i mousePosWindow;
sf::Vector2f mousePosView;
//Recources
std::map<std::string, sf::Texture> textures;
virtual void initKeyBinds() = 0;
public:
State(sf::RenderWindow* window, std::map<std::string, int>* supportedKeys, std::stack<State*>* states, sf::Event* sfEvent);
~State();
//Accessors
const bool& getQuit() const;
const bool getKeytime();
//Functions
void endState();
void setMusicVolume(int volume);
int getMusicVolume();
void pauseMusic();
void unpauseMusic();
void pauseState();
void unpauseState();
virtual void updateMousePositions();
virtual void updateKeytime(const float& dt);
virtual void updateInput(const float& dt) = 0;
virtual void update(const float& dt) = 0;
virtual void render(sf::RenderTarget* traget = nullptr) = 0;
};