ddnet/src/game/server/score.h

71 lines
1.9 KiB
C
Raw Normal View History

#ifndef GAME_SERVER_INTERFACE_SCORE_H
#define GAME_SERVER_INTERFACE_SCORE_H
#include "entities/character.h"
#include "gamecontext.h"
#define NUM_CHECKPOINTS 25
class CPlayerData
{
public:
CPlayerData()
{
Reset();
}
void Reset()
{
m_BestTime = 0;
m_CurrentTime = 0;
for(int i = 0; i < NUM_CHECKPOINTS; i++)
m_aBestCpTime[i] = 0;
}
void Set(float Time, float CpTime[NUM_CHECKPOINTS])
{
m_BestTime = Time;
for(int i = 0; i < NUM_CHECKPOINTS; i++)
m_aBestCpTime[i] = CpTime[i];
}
float m_BestTime;
float m_CurrentTime;
float m_aBestCpTime[NUM_CHECKPOINTS];
};
class IScore
{
CPlayerData m_aPlayerData[MAX_CLIENTS];
public:
virtual ~IScore() {}
CPlayerData *PlayerData(int ID) { return &m_aPlayerData[ID]; }
2014-10-11 10:58:27 +00:00
virtual void MapInfo(int ClientID, const char* MapName) = 0;
virtual void MapVote(int ClientID, const char* MapName) = 0;
2016-03-25 23:20:18 +00:00
virtual void CheckBirthday(int ClientID) = 0;
virtual void LoadScore(int ClientID) = 0;
virtual void SaveScore(int ClientID, float Time, float CpTime[NUM_CHECKPOINTS]) = 0;
2013-07-21 06:46:52 +00:00
virtual void SaveTeamScore(int* ClientIDs, unsigned int Size, float Time) = 0;
virtual void ShowTop5(IConsole::IResult *pResult, int ClientID, void *pUserData, int Debut=1) = 0;
virtual void ShowRank(int ClientID, const char* pName, bool Search=false) = 0;
2013-07-21 06:46:52 +00:00
virtual void ShowTeamTop5(IConsole::IResult *pResult, int ClientID, void *pUserData, int Debut=1) = 0;
virtual void ShowTeamRank(int ClientID, const char* pName, bool Search=false) = 0;
virtual void ShowTopPoints(IConsole::IResult *pResult, int ClientID, void *pUserData, int Debut=1) = 0;
virtual void ShowPoints(int ClientID, const char* pName, bool Search=false) = 0;
2014-06-20 20:40:23 +00:00
virtual void RandomMap(int ClientID, int stars) = 0;
virtual void RandomUnfinishedMap(int ClientID, int stars) = 0;
virtual void SaveTeam(int Team, const char* Code, int ClientID, const char* Server) = 0;
2014-07-26 12:46:31 +00:00
virtual void LoadTeam(const char* Code, int ClientID) = 0;
};
#endif