1 | /* (c) Shereef Marzouk. See "licence DDRace.txt" and the readme.txt in the root of the distribution for more information. */ |
2 | #ifndef GAME_TEAMSCORE_H |
3 | #define GAME_TEAMSCORE_H |
4 | |
5 | #include <engine/shared/protocol.h> |
6 | |
7 | enum |
8 | { |
9 | TEAM_FLOCK = 0, |
10 | TEAM_SUPER = MAX_CLIENTS, |
11 | NUM_DDRACE_TEAMS = TEAM_SUPER + 1, |
12 | VANILLA_TEAM_SUPER = VANILLA_MAX_CLIENTS |
13 | }; |
14 | |
15 | // do not change the values of the following enum |
16 | enum |
17 | { |
18 | SV_TEAM_FORBIDDEN = 0, // teams are disabled on the map |
19 | SV_TEAM_ALLOWED = 1, // teams are enabled on the map, but optional |
20 | SV_TEAM_MANDATORY = 2, // map must be played with a team |
21 | SV_TEAM_FORCED_SOLO = 3 // map forces a random team for each individual player |
22 | }; |
23 | |
24 | class CTeamsCore |
25 | { |
26 | int m_aTeam[MAX_CLIENTS]; |
27 | bool m_aIsSolo[MAX_CLIENTS]; |
28 | |
29 | public: |
30 | bool m_IsDDRace16; |
31 | |
32 | CTeamsCore(); |
33 | |
34 | bool SameTeam(int ClientId1, int ClientId2) const; |
35 | |
36 | bool CanKeepHook(int ClientId1, int ClientId2) const; |
37 | bool CanCollide(int ClientId1, int ClientId2) const; |
38 | |
39 | int Team(int ClientId) const; |
40 | void Team(int ClientId, int Team); |
41 | |
42 | void Reset(); |
43 | void SetSolo(int ClientId, bool Value); |
44 | bool GetSolo(int ClientId) const; |
45 | }; |
46 | |
47 | #endif |
48 | |