CSCommon: MLadderPicker.h 소스 파일

MAIET

MLadderPicker.h

00001 #ifndef _MLADDERPICKER_H
00002 #define _MLADDERPICKER_H
00003 
00004 #pragma once
00005 
00006 #include <list>
00007 #include <queue>
00008 #include <algorithm>
00009 using namespace std;
00010 
00011 
00012 
00013 class MLadderTicket {
00014 private: 
00015     int     m_nGroupID;
00016     int     m_nScore;
00017     int     m_nRandomArg;
00018 
00019     // 추가
00020     int     m_nCharLevel;       // 캐릭터 레벨 평균
00021     int     m_nClanPoint;       // 클랜 포인트
00022     int     m_nContPoint;       // 클랜 기여도 평균
00023 
00024     int     m_nTickCount;
00025 public:
00026     // 예전 액션리그 시절의 유물
00027     MLadderTicket(int nGroupID, int nScore, int nRandomArg) 
00028     {
00029         m_nGroupID = nGroupID;
00030         m_nScore = nScore;
00031         m_nRandomArg = nRandomArg;
00032 
00033         m_nCharLevel = 0;
00034         m_nClanPoint = 0;
00035         m_nContPoint = 0;
00036 
00037         m_nTickCount = 0;
00038     }
00039 
00040     MLadderTicket(int nGroupID, int nCharLevel, int nContPoint, int nClanPoint, int nTickCount, int nRandomArg)
00041     {
00042         m_nGroupID = nGroupID;
00043         m_nCharLevel = nCharLevel;
00044         m_nContPoint = nContPoint;
00045         m_nClanPoint = nClanPoint;
00046         m_nTickCount = nTickCount;
00047 
00048         m_nScore = 0;
00049         m_nRandomArg = nRandomArg;
00050     }
00051     int GetGroupID()    { return m_nGroupID; }
00052     int GetEvaluation() { return m_nScore + m_nRandomArg; }
00053 
00054     int GetCharLevel()  { return m_nCharLevel; }
00055     int GetClanPoint()  { return m_nClanPoint; }
00056     int GetContPoint()  { return m_nContPoint; }
00057     int GetTickCount()  { return m_nTickCount; }
00058 };
00059 
00060 class MLadderPicker {
00061 protected:
00062     list<MLadderTicket*>        m_LadderMatchList;
00063 
00064     bool Evaluate(MLadderTicket* pTicket, list<MLadderTicket*>::iterator* poutItorMatchedTicket);
00065     bool EvaluateTicket(MLadderTicket* pTicketA, MLadderTicket* pTicketB, float* poutTotalRate);
00066 public:
00067     void AddTicket(MLadderGroup* pGroup, int nRandomArg);   // 예전 액션리그 시절의 유물
00068     void AddTicket(MLadderGroup* pGroup, int nClanPoint, int nTickCount, int nRandomArg);
00069 
00070     bool PickMatch(int* pGroupA, int* pGroupB);
00071     void Shuffle();
00072 };
00073 
00074 
00075 #endif


MAIET entertainment