about summary refs log tree commit diff
path: root/src/game/server/gamecontext.hpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-08-14 18:25:44 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-08-14 18:25:44 +0000
commita420eb543f8206730aebb80e60a625f7204694e4 (patch)
tree235971d38c917c1b97c512743db64c2fd23ffadc /src/game/server/gamecontext.hpp
parent817f431377c7f1545621ff597c018b133651e991 (diff)
downloadzcatch-a420eb543f8206730aebb80e60a625f7204694e4.tar.gz
zcatch-a420eb543f8206730aebb80e60a625f7204694e4.zip
moved alot of stuff to their own cpp/hpp files
Diffstat (limited to 'src/game/server/gamecontext.hpp')
-rw-r--r--src/game/server/gamecontext.hpp38
1 files changed, 38 insertions, 0 deletions
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;