/* client/action.h This file is part of the Osirion project and is distributed under the terms and conditions of the GNU General Public License version 2 */ #ifndef __INCLUDED_CLIENT_ACTION_H__ #define __INCLUDED_CLIENT_ACTION_H__ #include namespace client { /** * @brief a client action key slot. * Actions are interpreted directly by the client and do not go throught the * command system. Actions are state keys: an action is enabled for as long * as the corresponding key is pressed down. */ class Action { public: /** * @brief type definition for the action type identifier * */ enum Identifier { None = 0, Console, Left, Right, Up, Down, RollLeft, RollRight, StrafeUp, StrafeDown, StrafeLeft, StrafeRight, ThrustUp, ThrustDown, Afterburner, Reverse, Control, LookLeft, LookRight, LookUp, LookDown, ZoomIn, ZoomOut, Fire, FreeLook }; /** * @brief define a new action * */ Action(const char *name, Identifier action, const char *description = 0); /** * @brief default destructor * */ ~Action(); /** * @brief action name * */ inline std::string const & name() const { return _name; } /** * @brief action type identifier * */ inline Identifier id() const { return _id; } /** * @brief text description * */ inline std::string const & description() const { return _description; } /** * @brief set the action's description * */ void set_description(const char *description); private: std::string _name; std::string _description; Identifier _id; }; } // namespace client #endif // __INCLUDED_CLIENT_ACTION_H__