GCP Assignment 1
StateManager.h
Go to the documentation of this file.
1 //DISCLAMER - This is a modified version of code from one of my other assignments.
2 
3 #pragma once
4 
5 #include <vector>
6 #include <iostream>
7 #include "State.h"
8 #include "GL/glew.h"
9 
14 {
15 public:
19  StateManager();
20 
24  ~StateManager();
25 
30  void addState(State* state);
31 
36  void changeState(State* state);
37 
41  void removeLastState();
42 
47  bool input();
48 
53  void update(float dt);
54 
58  void draw();
59 
60 private:
62  std::vector<State*> currentStates;
63 };
~StateManager()
Destructs a StateManager object.
Definition: StateManager.cpp:9
Creates a State object to be inherited.
Definition: State.h:15
void addState(State *state)
Adds a new state to the current stack of states.
Definition: StateManager.cpp:18
void changeState(State *state)
Changes the current State to a new State.
Definition: StateManager.cpp:23
Creates a StateManager object.
Definition: StateManager.h:13
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:46
void draw()
Definition: StateManager.cpp:57
void update(float dt)
Updates the current State.
Definition: StateManager.cpp:51
void removeLastState()
Removes the last State from the vector.
Definition: StateManager.cpp:38
StateManager()
Constructs a StateManager object.
Definition: StateManager.cpp:5