/* ========================================================================== * ÆÄ ÀÏ : PartyManager.h * ¸ñ Àû : * ÀÛ ¼º ÀÚ : ±è°¡¶÷ * ÀÛ ¼º ÀÏ : 2007-11-07 * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "Player_Common.h" #include "Party_Common.h" const unsigned long PARTY_WAIT_TIME = 10000; const unsigned long PARTY_POSUPDATE = 1000; const unsigned long PARTY_DATAUPDATE = 100; /// ³×Æ®¿öÅ© ¶ô enum { eLOCK_PARTYADD, eLOCK_PARTYOUT, eLOCK_PARTYCHANGELEADER, eLOCK_PARTYCHANGEDIVIDE, eLOCK_PARTYTHROW, }; /// ÆÄƼ ¸Å´ÏÀú class cPlayer; class cPartyManager { public: static cPartyManager* mpSingleton; public: cPartyManager(); ~cPartyManager(); void Open(); void Close(); void Clear(); void Process( unsigned long accumTime ); /// ³×Æ®¿öÅ© ¸Þ½ÃÁö void NetworkMsgParser( char* msg ); void RequestPartyAdd( LPCTSTR targetName ); void RequestChangeLeader(); void RequestChangeLeader( unsigned long playerIdx ); void RequestPartyOut(); void RequestThrow(); void RequestThrow( unsigned long playerIdx ); void RequestChangeDivide( PARTY_DIVIDE_TYPE type ); // bool IsHeroLeader(); bool IsHeroParty( unsigned long userIndex ); // void UpdateLevel( unsigned long userIndex, unsigned char level ); // ui Ŭ¸¯À¸·Î ÀÎÇÑ Å¸°ÙÆÃ void SetTargetByUI( unsigned long userIndex ); void SetTargetByArrIndex( unsigned int i ); // heroÀÇ Å¸°ÙÆÃÀ¸·Î ÀÎÇÔ void SetTargetByHero( unsigned long userIndex ); // Ÿ°ÙÆÃ Ŭ¸®¾î void ClearTarget(); // void ShowUI(); void HideUI(); // void ChangeDisplayType( unsigned char type ); void ClearAllBuff( unsigned long objectIdx ); void AddBuff( unsigned long objectIdx, unsigned long uniqueIdx, unsigned long influenceIdx ); void DeleteBuff( unsigned long objectIdx, unsigned long uniqueIdx ); void DeleteDeBuff( unsigned long objectIdx, unsigned long uniqueIdx ); LPCTSTR GetSelectUserName(); inline unsigned long GetLeaderIndex() { return mLeaderIndex; } bool IsDice() { return mIsDice; } sPartyUserData* GetPartyInfo( unsigned int index ); sPartyUserData* GetPartyInfoByUserIndex( unsigned long userIndex ); int GetPartyCount(){ return mCount; } PARTY_DIVIDE_TYPE GetPartyDivide() { return mDivideType; } public: static cPartyManager* GetSingleton(); private: bool AddPlayer( int i, sPartyUserData* data ); bool DeletePlayer( int i ); void UpdatePlayer( unsigned int i, unsigned long userIndex, unsigned char level, unsigned int maxhp, unsigned int maxmp, unsigned int hp, unsigned int mp, float posX, float posY ); bool UpdateBuff( unsigned int i, sInfluenceClient* data, long count ); bool UpdateBuff( unsigned int i, cPlayer* player ); void UpdateMap( unsigned int i, unsigned short mapnum, unsigned short roomnum, DWORD channelnum ); void UpdateJob( unsigned int i, ePLAYER_JOB job ); void UpdateMouseHover(); void UpdateMinimap(); int FindUser( unsigned long playerIndex ); void ShowStateUI( int i ); void HideStateUI( int i ); private: // sPartyUserData mParty[MAX_PARTY]; /// unsigned long mPartyIndex; /// ÆÄƼÀå À¯Àú À妽º unsigned long mLeaderIndex; /// Hero¸¦ Á¦¿ÜÇÏ°í ¼ÂÆÃµÈ ÆÄƼ Àοø¼ö int mCount; /// ÆÄƼ ºÐ¹è¹æ½Ä PARTY_DIVIDE_TYPE mDivideType; /// unsigned long mLastAccumTime; /// HP, MP °»½Å ½Ã°£ unsigned long mHPMPAccumTime; // ÆÄƼ½Åû Àӽà À¯ÀúÀ̸§ cStringT mTempTargetName; // ¼±ÅõǾîÀÖ´Â Á¤º¸ int mSelectArrIndex; // ÁÖ»çÀ§ ±¼¸®±â ÁßÀÎÁö bool mIsDice; }; inline cPartyManager* cPartyManager::GetSingleton() { return mpSingleton; } #define PARTYMAN cPartyManager::GetSingleton()