CSCommon: MLadderStatistics.h 소스 파일

MAIET

MLadderStatistics.h

00001 #ifndef _MLADDERSTATISTICS_H
00002 #define _MLADDERSTATISTICS_H
00003 
00004 #include "MMatchGlobal.h"
00005 
00006 #define LADDER_STATISTICS_LEVEL_UNIT            5       // 레벨은 5레벨을 한단위로 통계 계산
00007 #define LADDER_STATISTICS_CLANPOINT_UNIT        20      // 클랜포인트는 20을 한단위로 통계 계산
00008 #define LADDER_STATISTICS_CONTPOINT_UNIT        50      // 클랜기여도는 50을 한단위로 통계 계산
00009 
00010 
00011 #define MAX_LADDER_STATISTICS_LEVEL             20      // (99 / 5)
00012 #define MAX_LADDER_STATISTICS_CLANPOINT         200     // (4000 / 20)
00013 #define MAX_LADDER_STATISTICS_CONTPOINT         200     // (10000 / 50)
00014 
00015 
00016 class MLadderStatistics
00017 {
00018 private:
00019     struct _RECORD
00020     {
00021         unsigned long int nCount;
00022         unsigned long int nWinCount;
00023     };
00024 
00025     _RECORD             m_LevelVictoriesRates[MAX_LADDER_STATISTICS_LEVEL];
00026     _RECORD             m_ClanPointVictoriesRates[MAX_LADDER_STATISTICS_CLANPOINT];
00027     _RECORD             m_ContPointVictoriesRates[MAX_LADDER_STATISTICS_CONTPOINT];
00028 
00029     unsigned long       m_nLastTick;
00030     void Load();
00031     void Save();
00032     unsigned long GetLastTick() { return m_nLastTick; }
00033     void SetLastTick(unsigned long nTick)   { m_nLastTick = nTick; }
00034 
00035     void _InsertLevelRecord(int nLevelDiff, bool bMoreLevelWin);
00036     void _InsertClanPointRecord(int nClanPointDiff, bool bMorePointWin);
00037     void _InsertContPointRecord(int nContPointDiff, bool bMorePointWin);
00038 public:
00039     MLadderStatistics();
00040     virtual ~MLadderStatistics();
00041     void Init();
00042     void Tick(unsigned long nTick);
00043 
00044 
00045     float GetLevelVictoriesRate(int nLevelDiff);
00046     float GetClanPointVictoriesRate(int nClanPointDiff);
00047     float GetContPointVictoriesRate(int nContPointDiff);
00048 
00049 
00050     void InsertLevelRecord(int nRedTeamCharLevel, int nBlueTeamCharLevel, MMatchTeam nWinnerTeam);
00051     void InsertClanPointRecord(int nRedTeamClanPoint, int nBlueTeamClanPoint, MMatchTeam nWinnerTeam);
00052     void InsertContPointRecord(int nRedTeamContPoint, int nBlueTeamContPoint, MMatchTeam nWinnerTeam);
00053 
00054     void PrintDebug();
00055 };
00056 
00057 
00058 
00059 
00060 #endif


MAIET entertainment