2010-04-05 23:38:59 +02:00
|
|
|
#ifndef _CONTROLLER_H
|
|
|
|
#define _CONTROLLER_H
|
|
|
|
|
|
|
|
#include "Engine.h"
|
|
|
|
#include "ControllerBase.h"
|
|
|
|
|
|
|
|
namespace asteroids {
|
|
|
|
|
|
|
|
/** \brief All possible controller states for an Entity
|
|
|
|
*
|
|
|
|
* These are used by the controller to update the current state of an Entity
|
|
|
|
* (e.g. EntityPhysicState).
|
|
|
|
*/
|
|
|
|
enum EntityControllerKeyState {
|
|
|
|
EntityKeyStateForward = 0,
|
|
|
|
EntityKeyStateTurnLeft,
|
|
|
|
EntityKeyStateTurnRight,
|
|
|
|
EntityKeyStateLast
|
|
|
|
};
|
|
|
|
|
|
|
|
class Controller : public Engine::ControllerBase {
|
|
|
|
public:
|
|
|
|
Controller () {};
|
|
|
|
protected:
|
|
|
|
/** \brief Set up basic keybindings */
|
|
|
|
virtual int OnInit (int argc, char* argv[]);
|
|
|
|
/** \brief Registers the commands of the cnotroller */
|
|
|
|
virtual void OnRegisterCommands ();
|
2010-09-11 02:28:50 +02:00
|
|
|
virtual bool OnReceiveEvent (const Engine::EventBasePtr &event);
|
2010-04-05 23:38:59 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif // _CONTROLLER_H
|