2010-08-28 13:47:52 +00:00
|
|
|
#ifndef GAME_SERVER_TEAMS_H
|
|
|
|
#define GAME_SERVER_TEAMS_H
|
|
|
|
|
2010-08-30 12:13:43 +00:00
|
|
|
#include <game/teamscore.h>
|
2010-08-28 13:47:52 +00:00
|
|
|
#include <game/server/gamecontext.h>
|
|
|
|
|
2010-08-30 12:13:43 +00:00
|
|
|
class CGameTeams {
|
2010-08-28 13:47:52 +00:00
|
|
|
int m_TeamState[MAX_CLIENTS];
|
|
|
|
bool m_TeeFinished[MAX_CLIENTS];
|
2010-08-28 20:53:42 +00:00
|
|
|
|
|
|
|
class CGameContext * m_pGameContext;
|
2010-08-28 13:47:52 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
enum {
|
|
|
|
EMPTY,
|
|
|
|
OPEN,
|
|
|
|
CLOSED,
|
|
|
|
STARTED,
|
|
|
|
FINISHED
|
|
|
|
};
|
|
|
|
|
2010-08-30 12:13:43 +00:00
|
|
|
CTeamsCore m_Core;
|
|
|
|
|
|
|
|
CGameTeams(CGameContext *pGameContext);
|
2010-08-28 13:47:52 +00:00
|
|
|
|
|
|
|
//helper methods
|
2010-08-28 20:53:42 +00:00
|
|
|
CCharacter* Character(int id) { return GameServer()->GetPlayerChar(id); }
|
|
|
|
|
|
|
|
class CGameContext *GameServer() { return m_pGameContext; }
|
|
|
|
class IServer *Server() { return m_pGameContext->Server(); }
|
2010-08-28 13:47:52 +00:00
|
|
|
|
|
|
|
void OnCharacterStart(int id);
|
|
|
|
void OnCharacterFinish(int id);
|
|
|
|
|
|
|
|
bool SetCharacterTeam(int id, int Team);
|
|
|
|
|
|
|
|
void ChangeTeamState(int Team, int State);
|
|
|
|
|
|
|
|
bool TeamFinished(int Team);
|
2010-09-08 16:22:11 +00:00
|
|
|
|
|
|
|
int TeamMask(int Team);
|
2010-08-28 13:47:52 +00:00
|
|
|
};
|
|
|
|
|
2010-09-08 16:22:11 +00:00
|
|
|
#endif
|