/* ========================================================================== * ÆÄ ÀÏ : PartyUnionManager.h * ¸ñ Àû : * ÀÛ ¼º ÀÚ : ±è°¡¶÷ * ÀÛ ¼º ÀÏ : 2009-06-03 * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "Player.h" #include "PartyUnion.h" #include "IndexGenerator.h" const unsigned long PARTYUNION_UPDATETIME = 5000; class cPartyUnionManager { static cPartyUnionManager* mpSingleton; public: cPartyUnionManager(); ~cPartyUnionManager(); bool Init(); void Release(); void Process( unsigned long elapsedTime, unsigned long accumTime ); cPartyUnion* AllocPartyUnion(); void FreePartyUnion( cPartyUnion* party ); cPartyUnion* GetUnion( unsigned long index ); // ¿¬ÇÕ »ý¼º unsigned long CreateUnion(); bool AddUser( unsigned long index, unsigned long userIdx ); // ¿¬ÇÕ °¡ÀÔ bool DeleteUser( cPlayer* player ); // ¿¬ÇÕ Å»Åð int MoveUser( unsigned long leaderIdx, unsigned char i0, unsigned char i1 ); // À̵¿ÇÒ ¹è¿­À妽º int ChangeLeader( unsigned long leaderIdx, unsigned long userIdx ); // ¿¬ÇÕÀå À§ÀÓ // void MapIn( cPlayer* player ); protected: bool DeleteUnion( unsigned long index ); // void SendUnionList( unsigned long index, unsigned long userIdx ); // À¯Àú¿¡°Ô ¿¬ÇÕÁ¤º¸ send void SendUnionAddOne( unsigned long index, unsigned long userIdx, unsigned int arrIdx ); // ±âÁ¸À¯Àú¿¡°Ô »õ À¯ÀúÁ¤º¸ send void SendUnionOutSyn( unsigned long index, unsigned long userIdx ); // À¯Àú Å»Åð ¾Ë¸² void SendUnionChangeLeader( unsigned long index, unsigned long userIdx ); void SendUnionMoveUser( unsigned long index, unsigned char i0, unsigned char i1 ); void SendUnionUpdate( cPartyUnion* p ); // ¿¬ÇÕ Àüü Á¤º¸ °»½Å void SendUnionGroupUpdate( cPartyUnion* p ); // ±×·ì Á¤º¸¸¸ °»½Å public: static cPartyUnionManager* GetSingleton(); private: cIndexGenerator mIndexGen; typedef tPool cPartyUnionPool; cPartyUnionPool mPartyPool; typedef tPointerHashMap cPartyUnionMap; cPartyUnionMap mPartyUnionMap; }; inline cPartyUnion* cPartyUnionManager::AllocPartyUnion() { return mPartyPool.Alloc(); } inline void cPartyUnionManager::FreePartyUnion( cPartyUnion* party ) { mPartyPool.Free( party ); } inline cPartyUnionManager* cPartyUnionManager::GetSingleton() { return mpSingleton; } #define PARTYUNIONMAN cPartyUnionManager::GetSingleton()