mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-13 11:38:19 +00:00
896634a061
Signed-off-by: GreYFoXGTi <GreYFoXGTi@GMaiL.CoM>
50 lines
942 B
C++
50 lines
942 B
C++
#ifndef GAME_SERVER_TEAMS_H
|
|
#define GAME_SERVER_TEAMS_H
|
|
|
|
#include <game/teamscore.h>
|
|
#include <game/server/gamecontext.h>
|
|
|
|
class CGameTeams {
|
|
int m_TeamState[MAX_CLIENTS];
|
|
bool m_TeeFinished[MAX_CLIENTS];
|
|
|
|
class CGameContext * m_pGameContext;
|
|
|
|
public:
|
|
enum {
|
|
EMPTY,
|
|
OPEN,
|
|
CLOSED,
|
|
STARTED,
|
|
FINISHED
|
|
};
|
|
|
|
CTeamsCore m_Core;
|
|
|
|
CGameTeams(CGameContext *pGameContext);
|
|
|
|
//helper methods
|
|
CCharacter* Character(int id) { return GameServer()->GetPlayerChar(id); }
|
|
|
|
class CGameContext *GameServer() { return m_pGameContext; }
|
|
class IServer *Server() { return m_pGameContext->Server(); }
|
|
|
|
void OnCharacterStart(int id);
|
|
void OnCharacterFinish(int id);
|
|
|
|
bool SetCharacterTeam(int id, int Team);
|
|
|
|
void ChangeTeamState(int Team, int State);
|
|
|
|
bool TeamFinished(int Team);
|
|
|
|
int TeamMask(int Team);
|
|
|
|
//need to be very carefull using this method
|
|
void SetForceCharacterTeam(int id, int Team);
|
|
|
|
void Reset();
|
|
};
|
|
|
|
#endif
|