2010-08-23 19:37:27 +00:00
|
|
|
#ifndef GAME_SERVER_INTERFACE_SCORE_H
|
|
|
|
#define GAME_SERVER_INTERFACE_SCORE_H
|
2010-07-29 05:21:18 +00:00
|
|
|
|
2010-08-23 19:37:27 +00:00
|
|
|
#include "entities/character.h"
|
|
|
|
#include "gamecontext.h"
|
2010-08-20 17:45:09 +00:00
|
|
|
|
2010-11-04 18:10:51 +00:00
|
|
|
#define NUM_CHECKPOINTS 25
|
2010-07-29 05:21:18 +00:00
|
|
|
|
2010-08-23 19:37:27 +00:00
|
|
|
class CPlayerData
|
2010-07-29 05:21:18 +00:00
|
|
|
{
|
|
|
|
public:
|
2010-08-23 19:37:27 +00:00
|
|
|
CPlayerData()
|
|
|
|
{
|
|
|
|
Reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Reset()
|
|
|
|
{
|
|
|
|
m_BestTime = 0;
|
|
|
|
m_CurrentTime = 0;
|
2010-11-04 18:10:51 +00:00
|
|
|
for(int i = 0; i < NUM_CHECKPOINTS; i++)
|
2010-08-23 19:37:27 +00:00
|
|
|
m_aBestCpTime[i] = 0;
|
|
|
|
}
|
|
|
|
|
2010-11-04 18:10:51 +00:00
|
|
|
void Set(float Time, float CpTime[NUM_CHECKPOINTS])
|
2010-08-23 19:37:27 +00:00
|
|
|
{
|
|
|
|
m_BestTime = Time;
|
2010-11-04 18:10:51 +00:00
|
|
|
for(int i = 0; i < NUM_CHECKPOINTS; i++)
|
2010-08-23 19:37:27 +00:00
|
|
|
m_aBestCpTime[i] = CpTime[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
float m_BestTime;
|
|
|
|
float m_CurrentTime;
|
2010-11-04 18:10:51 +00:00
|
|
|
float m_aBestCpTime[NUM_CHECKPOINTS];
|
2010-07-29 05:21:18 +00:00
|
|
|
};
|
|
|
|
|
2010-08-23 19:37:27 +00:00
|
|
|
class IScore
|
2010-07-29 05:21:18 +00:00
|
|
|
{
|
2010-08-23 19:37:27 +00:00
|
|
|
CPlayerData m_aPlayerData[MAX_CLIENTS];
|
|
|
|
|
2010-07-29 05:21:18 +00:00
|
|
|
public:
|
2010-08-23 19:37:27 +00:00
|
|
|
virtual ~IScore() {}
|
|
|
|
|
|
|
|
CPlayerData *PlayerData(int ID) { return &m_aPlayerData[ID]; }
|
|
|
|
|
2013-11-28 14:11:59 +00:00
|
|
|
virtual void MapPoints(int ClientID, const char* MapName) = 0;
|
2010-08-23 19:37:27 +00:00
|
|
|
virtual void LoadScore(int ClientID) = 0;
|
2011-06-06 19:24:27 +00:00
|
|
|
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;
|
2010-08-23 19:37:27 +00:00
|
|
|
|
2011-08-13 00:11:06 +00:00
|
|
|
virtual void ShowTop5(IConsole::IResult *pResult, int ClientID, void *pUserData, int Debut=1) = 0;
|
2010-08-23 19:37:27 +00:00
|
|
|
virtual void ShowRank(int ClientID, const char* pName, bool Search=false) = 0;
|
2013-07-21 02:52:23 +00:00
|
|
|
|
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;
|
|
|
|
|
2013-07-21 02:52:23 +00:00
|
|
|
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;
|
2010-07-29 05:21:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|