Level H Engine
StateManager.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 #include "State.h"
5 
10 {
11 public:
15  StateManager();
16 
20  ~StateManager();
21 
26  void addState(State* state);
27 
32  void changeState(State* state);
33 
37  void removeLastState();
38 
42  void destructPreviousState();
43 
48  bool input();
49 
53  void update();
54 
58  void draw();
59 
60 private:
62  std::vector<State*> currentStates;
63 };
~StateManager()
Destructs a StateManager object.
Definition: StateManager.cpp:10
Creates a State object to be inherited.
Definition: State.h:13
void addState(State *state)
Adds a new state to the current stack of states.
Definition: StateManager.cpp:19
void changeState(State *state)
Changes the current State to a new State.
Definition: StateManager.cpp:25
Creates a StateManager object.
Definition: StateManager.h:9
void update()
Updates the current State.
Definition: StateManager.cpp:63
std::vector< State * > currentStates
The current states that are in use.
Definition: StateManager.h:62
bool input()
Handles the user input in the current State.
Definition: StateManager.cpp:58
void draw()
Definition: StateManager.cpp:69
void removeLastState()
Removes the last State from the vector.
Definition: StateManager.cpp:43
void destructPreviousState()
A function to destruct the first state on the array.
Definition: StateManager.cpp:53
StateManager()
Constructs a StateManager object.
Definition: StateManager.cpp:6