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-08-23 19:37:27 +00:00
|
|
|
#define NUM_TELEPORT 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;
|
|
|
|
for(int i = 0; i < NUM_TELEPORT; i++)
|
|
|
|
m_aBestCpTime[i] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Set(float Time, float CpTime[NUM_TELEPORT])
|
|
|
|
{
|
|
|
|
m_BestTime = Time;
|
|
|
|
for(int i = 0; i < NUM_TELEPORT; i++)
|
|
|
|
m_aBestCpTime[i] = CpTime[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
float m_BestTime;
|
|
|
|
float m_CurrentTime;
|
|
|
|
float m_aBestCpTime[NUM_TELEPORT];
|
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]; }
|
|
|
|
|
|
|
|
virtual void LoadScore(int ClientID) = 0;
|
|
|
|
virtual void SaveScore(int ClientID, float Time, CCharacter *pChar) = 0;
|
|
|
|
|
|
|
|
virtual void ShowTop5(int ClientID, int Debut=1) = 0;
|
|
|
|
virtual void ShowRank(int ClientID, const char* pName, bool Search=false) = 0;
|
2010-07-29 05:21:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|