-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditorState.h
74 lines (53 loc) · 1.4 KB
/
EditorState.h
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
#pragma once
#include "State.h"
#include "PauseMenu.h"
#include "TileMap.h"
#include "EditorModes.h"
enum class EditorModes : unsigned int
{
Default = 0,
Enemy
};
class EditorState :
public State
{
private:
//private: Variables:
EditorStateData editorStateData;
sf::View view;
sf::Vector2i viewGridPosition;
float cameraSpeed;
sf::Font font;
PauseMenu* pauseMenu;
std::map<std::string, gui::Button*> buttons;
TileMap* tileMap;
std::vector<EditorMode*> modes;
unsigned int activeMode;
//private: Functions:
//Initialization funtcions:
void initVariables();
void initEditorStateData();
void initView();
void initPauseMenu();
void initButtons();
void initGui();
void initTileMap();
void initModes();
public:
//Constructors and Destructor:
EditorState(StateData* state_data);
virtual ~EditorState();
//Functions:
void updateView(const float& dt);
void updateInput(const float& dt);
void updateEditorInput(const float& dt);
void updateButtons(const float& dt);
void updateGui(const float& dt);
void updatePauseMenuButtons();
void updateModes(const float& dt);
void update(const float& dt);
void renderButtons(sf::RenderTarget& target);
void renderGui(sf::RenderTarget& target);
void renderModes(sf::RenderTarget& target);
void render(sf::RenderTarget* target = nullptr);
};