From a420eb543f8206730aebb80e60a625f7204694e4 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Thu, 14 Aug 2008 18:25:44 +0000 Subject: moved alot of stuff to their own cpp/hpp files --- src/game/server/gamecontext.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/game/server/gamecontext.hpp (limited to 'src/game/server/gamecontext.hpp') diff --git a/src/game/server/gamecontext.hpp b/src/game/server/gamecontext.hpp new file mode 100644 index 00000000..c4035b3f --- /dev/null +++ b/src/game/server/gamecontext.hpp @@ -0,0 +1,38 @@ + +#include "eventhandler.hpp" +#include "gamecontroller.hpp" +#include "gameworld.hpp" + +class GAMECONTEXT +{ +public: + GAMECONTEXT(); + void clear(); + + EVENTHANDLER events; + PLAYER players[MAX_CLIENTS]; + + GAMECONTROLLER *controller; + GAMEWORLD world; + + void tick(); + void snap(int client_id); + + // helper functions + void create_damageind(vec2 p, float angle_mod, int amount); + void create_explosion(vec2 p, int owner, int weapon, bool bnodamage); + void create_smoke(vec2 p); + void create_playerspawn(vec2 p); + void create_death(vec2 p, int who); + void create_sound(vec2 pos, int sound, int mask=-1); + void create_sound_global(int sound, int target=-1); + + // network + void send_chat(int cid, int team, const char *text); + void send_emoticon(int cid, int emoticon); + void send_weapon_pickup(int cid, int weapon); + void send_broadcast(const char *text, int cid); + void send_info(int who, int to_who); +}; + +extern GAMECONTEXT game; -- cgit 1.4.1