DDNet documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
teamscore.h
Go to the documentation of this file.
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
LEGACY_TEAM_SUPER
=
LEGACY_MAX_CLIENTS
,
13
VANILLA_TEAM_SUPER
=
VANILLA_MAX_CLIENTS
14
};
15
16
// do not change the values of the following enum
17
enum
18
{
19
SV_TEAM_FORBIDDEN
= 0,
// teams are disabled on the map
20
SV_TEAM_ALLOWED
= 1,
// teams are enabled on the map, but optional
21
SV_TEAM_MANDATORY
= 2,
// map must be played with a team
22
SV_TEAM_FORCED_SOLO
= 3
// map forces a random team for each individual player
23
};
24
25
class
CTeamsCore
26
{
27
int
m_aTeam
[
MAX_CLIENTS
];
28
bool
m_aIsSolo
[
MAX_CLIENTS
];
29
30
public
:
31
int
m_NumDDRaceTeams
;
32
33
CTeamsCore
();
34
35
int
TeamSuper
()
const
36
{
37
return
m_NumDDRaceTeams
- 1;
38
}
39
40
bool
SameTeam
(
int
ClientId1,
int
ClientId2)
const
;
41
42
bool
CanKeepHook
(
int
ClientId1,
int
ClientId2)
const
;
43
bool
CanCollide
(
int
ClientId1,
int
ClientId2)
const
;
44
45
int
Team
(
int
ClientId)
const
;
46
void
Team
(
int
ClientId,
int
Team
);
47
48
void
Reset
();
49
void
SetSolo
(
int
ClientId,
bool
Value);
50
bool
GetSolo
(
int
ClientId)
const
;
51
};
52
53
#endif
CTeamsCore::Reset
void Reset()
Definition
teamscore.cpp:45
CTeamsCore::TeamSuper
int TeamSuper() const
Definition
teamscore.h:35
CTeamsCore::Team
int Team(int ClientId) const
Definition
teamscore.cpp:18
CTeamsCore::m_aIsSolo
bool m_aIsSolo[MAX_CLIENTS]
Definition
teamscore.h:28
CTeamsCore::CTeamsCore
CTeamsCore()
Definition
teamscore.cpp:8
CTeamsCore::SetSolo
void SetSolo(int ClientId, bool Value)
Definition
teamscore.cpp:59
CTeamsCore::SameTeam
bool SameTeam(int ClientId1, int ClientId2) const
Definition
teamscore.cpp:13
CTeamsCore::CanKeepHook
bool CanKeepHook(int ClientId1, int ClientId2) const
Definition
teamscore.cpp:29
CTeamsCore::m_NumDDRaceTeams
int m_NumDDRaceTeams
Definition
teamscore.h:31
CTeamsCore::CanCollide
bool CanCollide(int ClientId1, int ClientId2) const
Definition
teamscore.cpp:36
CTeamsCore::GetSolo
bool GetSolo(int ClientId) const
Definition
teamscore.cpp:65
CTeamsCore::m_aTeam
int m_aTeam[MAX_CLIENTS]
Definition
teamscore.h:27
protocol.h
LEGACY_MAX_CLIENTS
@ LEGACY_MAX_CLIENTS
Definition
protocol.h:92
MAX_CLIENTS
@ MAX_CLIENTS
Definition
protocol.h:89
VANILLA_MAX_CLIENTS
@ VANILLA_MAX_CLIENTS
Definition
protocol.h:90
LEGACY_TEAM_SUPER
@ LEGACY_TEAM_SUPER
Definition
teamscore.h:12
TEAM_SUPER
@ TEAM_SUPER
Definition
teamscore.h:10
VANILLA_TEAM_SUPER
@ VANILLA_TEAM_SUPER
Definition
teamscore.h:13
TEAM_FLOCK
@ TEAM_FLOCK
Definition
teamscore.h:9
NUM_DDRACE_TEAMS
@ NUM_DDRACE_TEAMS
Definition
teamscore.h:11
SV_TEAM_FORBIDDEN
@ SV_TEAM_FORBIDDEN
Definition
teamscore.h:19
SV_TEAM_ALLOWED
@ SV_TEAM_ALLOWED
Definition
teamscore.h:20
SV_TEAM_MANDATORY
@ SV_TEAM_MANDATORY
Definition
teamscore.h:21
SV_TEAM_FORCED_SOLO
@ SV_TEAM_FORCED_SOLO
Definition
teamscore.h:22
src
game
teamscore.h
Generated by
1.18.0