#include "context.h" #include #include using namespace std; class State { public: State(){} virtual ~State(){} virtual void doAction(Context *context) = 0; virtual string getString() = 0; }; class StartState: public State { public: void doAction(Context *context) { cout << "Player is in start state" << endl; context->setState(this); } string getString() { return "Start State"; } }; class StopState: public State { public: void doAction(Context *context) { cout << "Player is in stop state" << endl; context->setState(this); } string getString() { return "Stop State"; } };