CSCommon: MTeamGameStrategy.h 소스 파일

MAIET

MTeamGameStrategy.h

00001 #ifndef _MTEAMGAMESTRATEGY_H
00002 #define _MTEAMGAMESTRATEGY_H
00003 
00004 #include "MMatchGlobal.h"
00005 #include <vector>
00006 using namespace std;
00007 
00008 class MMatchObject;
00009 class MLadderGroup;
00010 class MMatchStage;
00011 
00012 class MLadderGameStrategy;
00013 class MClanGameStrategy;
00014 struct MMatchLadderTeamInfo;
00015 
00016 class MBaseTeamGameStrategy
00017 {
00018 protected:
00019     MBaseTeamGameStrategy() { }
00020     virtual ~MBaseTeamGameStrategy() { }
00021 public:
00023     virtual int ValidateChallenge(MMatchObject** ppMemberObject, int nMemberCount) = 0;
00024 
00026     virtual int ValidateRequestInviteProposal(MMatchObject* pProposerObject, MMatchObject** ppReplierObjects,
00027                     const int nReplierCount) = 0;
00029     virtual int GetNewGroupID(MMatchObject* pLeaderObject, MMatchObject** ppMemberObjects, int nMemberCount) = 0;
00030 
00032     virtual void SetLadderGroup(MLadderGroup* pGroup, MMatchObject** ppMemberObjects, int nMemberCount) = 0;
00033 
00035     virtual void SetStageLadderInfo(MMatchLadderTeamInfo* poutRedLadderInfo, MMatchLadderTeamInfo* poutBlueLadderInfo,
00036                                     MLadderGroup* pRedGroup, MLadderGroup* pBlueGroup) = 0;
00037 
00039     virtual void SavePointOnFinishGame(MMatchStage* pStage, MMatchTeam nWinnerTeam, bool bIsDrawGame,
00040                                        MMatchLadderTeamInfo* pRedLadderInfo, MMatchLadderTeamInfo* pBlueLadderInfo) = 0;
00041 
00042     virtual int GetRandomMap(int nTeamMember) = 0;
00043 
00045     static MBaseTeamGameStrategy* GetInstance(MMatchServerMode nServerMode);
00046 };
00047 
00048 
00049 class MLadderGameStrategy : public MBaseTeamGameStrategy
00050 {
00051 protected:
00052     MLadderGameStrategy() { }
00053 public:
00054     static MLadderGameStrategy* GetInstance()
00055     {
00056         static MLadderGameStrategy m_stInstance;
00057         return &m_stInstance;
00058     }
00059     virtual int ValidateChallenge(MMatchObject** ppMemberObject, int nMemberCount);
00060     virtual int ValidateRequestInviteProposal(MMatchObject* pProposerObject, MMatchObject** ppReplierObjects,
00061                     const int nReplierCount);
00062     virtual int GetNewGroupID(MMatchObject* pLeaderObject, MMatchObject** ppMemberObjects, int nMemberCount);
00063     virtual void SetLadderGroup(MLadderGroup* pGroup, MMatchObject** ppMemberObjects, int nMemberCount) { }
00064     virtual void SetStageLadderInfo(MMatchLadderTeamInfo* poutRedLadderInfo, MMatchLadderTeamInfo* poutBlueLadderInfo,
00065                                     MLadderGroup* pRedGroup, MLadderGroup* pBlueGroup);
00066     virtual void SavePointOnFinishGame(MMatchStage* pStage, MMatchTeam nWinnerTeam, bool bIsDrawGame,
00067                                        MMatchLadderTeamInfo* pRedLadderInfo, MMatchLadderTeamInfo* pBlueLadderInfo);
00068     virtual int GetRandomMap(int nTeamMember);
00069 };
00070 
00071 
00072 class MClanGameStrategy : public MBaseTeamGameStrategy
00073 {
00074 protected:
00075     MClanGameStrategy();
00076     vector<int>     m_RandomMapVec[MLADDERTYPE_MAX];
00077 public:
00078     static MClanGameStrategy* GetInstance()
00079     {
00080         static MClanGameStrategy m_stInstance;
00081         return &m_stInstance;
00082     }
00083 
00084     virtual int ValidateChallenge(MMatchObject** ppMemberObject, int nMemberCount);
00085     virtual int ValidateRequestInviteProposal(MMatchObject* pProposerObject, MMatchObject** ppReplierObjects,
00086                     const int nReplierCount);
00087     virtual int GetNewGroupID(MMatchObject* pLeaderObject, MMatchObject** ppMemberObjects, int nMemberCount);
00088     virtual void SetLadderGroup(MLadderGroup* pGroup, MMatchObject** ppMemberObjects, int nMemberCount);
00089     virtual void SetStageLadderInfo(MMatchLadderTeamInfo* poutRedLadderInfo, MMatchLadderTeamInfo* poutBlueLadderInfo,
00090                                     MLadderGroup* pRedGroup, MLadderGroup* pBlueGroup);
00091     virtual void SavePointOnFinishGame(MMatchStage* pStage, MMatchTeam nWinnerTeam, bool bIsDrawGame,
00092                                        MMatchLadderTeamInfo* pRedLadderInfo, MMatchLadderTeamInfo* pBlueLadderInfo);
00093     virtual int GetRandomMap(int nTeamMember);
00094 };
00095 
00096 
00097 
00098 
00099 
00100 
00101 
00102 #endif


MAIET entertainment