about summary refs log tree commit diff
path: root/src/game/server/gamecontext.hpp
blob: c4035b3f67cdc2e5f6c06368d61f2feee3a980e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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;