From a1eb1b4dc4d81df724ee43fc4e895dd22e81760f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 9 Nov 2008 21:45:18 +0000 Subject: working jumpgates --- src/game/base/game.h | 104 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 src/game/base/game.h (limited to 'src/game/base/game.h') diff --git a/src/game/base/game.h b/src/game/base/game.h new file mode 100644 index 0000000..bc9d1f7 --- /dev/null +++ b/src/game/base/game.h @@ -0,0 +1,104 @@ +/* + base/game.h + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +#ifndef __INCLUDED_BASE_H__ +#define __INCLUDED_BASE_H__ + +#include +#include + +#include "base/ship.h" +#include "base/shipmodel.h" +#include "base/star.h" +#include "core/core.h" +#include "filesystem/inifile.h" +#include "sys/sys.h" + +/// the base game module +/** the base game module contains the game-specific code for Project::OSiRiON + */ +namespace game +{ + +// entity type constants +const unsigned int ship_enttype = 256; +const unsigned int star_enttype = 257; +const unsigned int planet_enttype = 258; +const unsigned int navpoint_enttype = 259; +const unsigned int jumppoint_enttype = 260; +const unsigned int jumpgate_enttype = 261; +const unsigned int station_enttype = 262; + +/// the base Project::OSiRiON game model +class Game : public core::Module { +public: + Game(); + ~Game(); + + /// run one time frame + void frame(float seconds); + + /// is called when a player connects + void player_connect(core::Player *player); + + /// is called when a player disconnects + void player_disconnect(core::Player *player); + + /* --- game variables -------------------------------------- */ + + /// game variable: speed of the impulse drive + static core::Cvar *g_impulsespeed; + + /// game variable: acceleration of the impulse drive + static core::Cvar *g_impulseacceleration; + + /// game variable strafe speed + static core::Cvar *g_strafespeed; + + /// game variable: jumppoint range + static core::Cvar *g_jumppointrange; + + /// game variable: enable or disable development mode + static core::Cvar *g_devel; + +protected: + /// initialize the game + void init(); + + /// shutdown the game + void shutdown(); + +private: + + bool load_world(); + + bool load_zone(core::Zone *zone); + + bool validate_zone(core::Zone *zone); + + bool load_ships(); + + static core::Zone *default_zone; + static ShipModel *default_shipmodel; + + /* ---- engine functions ----------------------------------- */ + + static void func_list_ship(std::string const &args); + static void func_join(core::Player *player, std::string const &args); + static void func_spectate(core::Player *player, std::string const &args); + static void func_buy(core::Player *player, std::string const &args); + static void func_hail(core::Player *player, std::string const &args); + static void func_jump(core::Player *player, std::string const &args); + static void func_impulse(core::Player *player, std::string const &args); + static void func_dock(core::Player *player,core::Entity *entity); + static void func_launch(core::Player *player, std::string const &args); + static void func_goto(core::Player *player, const std::string &args); +}; + +} + +#endif // __INCLUDED_BASE_H__ + -- cgit v1.2.3