Created
August 17, 2012 19:51
-
-
Save luizdepra/3382006 to your computer and use it in GitHub Desktop.
StateMachine State
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __STATE_H__ | |
#define __STATE_H__ | |
#include <string> | |
class State | |
{ | |
public: | |
State(const std::string &name, void (*startFunction)(), void (*updateFunction)(float), void (*stopFunction)()); | |
~State(); | |
std::string getName(); | |
void start(); | |
void update(float delta); | |
void stop(); | |
private: | |
std::string _name; | |
void (*_startFunction); | |
void (*_updateFunction)(float); | |
void (*_stopFunction)(); | |
} | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __STATE_H__ | |
#define __STATE_H__ | |
#include <string> | |
#include <map> | |
#include "State.h" | |
class StateMachine | |
{ | |
public: | |
StateMachine(); | |
~StateMachine(); | |
void createState(const std::string &name, void (*startFunction)(), void (*updateFunction)(float), void (*stopFunction)()); | |
void addState(const State &state); | |
void remove | |
void update(float delta); | |
private: | |
std::map<std::string, State> _stateMap; | |
} | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment