/* ========================================================================== * ÆÄ ÀÏ : PartyUnionManager.h * ¸ñ Àû : * ÀÛ ¼º ÀÚ : ±è°¡¶÷ * ÀÛ ¼º ÀÏ : 2009-06-04 * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "Party_Common.h" #include "UnionIcon.h" const unsigned long PARTYUNION_DATAUPDATE = 100; const unsigned long PARTYUNION_POSUPDATE = 1000; class cPlayer; class cPartyUnionManager { public: static cPartyUnionManager* mpSingleton; public: cPartyUnionManager(); ~cPartyUnionManager(); void Close(); void Clear(); void Process( unsigned long accumTime ); /// ³×Æ®¿öÅ© ¸Þ½ÃÁö void NetworkMsgParser( char* msg ); bool TryToMovePlayer( unsigned char i0, unsigned char i1 ); bool TryToChangeLeader( unsigned long playerIndex ); // void LinkIcon( cUnionIcon* icon ); void UnLinkIcon(); sUnionUserData* GetData( int i ); bool IsHeroLeader(); bool IsHeroParty( unsigned long userIndex ); // ui Ŭ¸¯À¸·Î ÀÎÇÑ Å¸°ÙÆÃ void SetTargetByUI( unsigned long userIndex ); // heroÀÇ Å¸°ÙÆÃÀ¸·Î ÀÎÇÔ void SetTargetByHero( unsigned long userIndex ); // Ÿ°ÙÆÃ Ŭ¸®¾î void ClearTarget(); // int GetGroup( unsigned long userIndex ); void ShowUI(); void HideUI(); void ChangeDisplayType( unsigned char type ); // Å« ¿¬ÇÕâ°ú ÀÛÀº¿¬ÇÕâÀº °°ÀÌ ¿­¸®Áö ¾Ê´Â´Ù void ShowLargeUnionUI( bool show ); 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 ); void SetPvpLeader( unsigned long characterIndex ); /// ÀüÀå¿¡¼­ ¼öÀå Ç¥½Ã. void SetFlagPlayer( unsigned long characterIndex ); /// Ç÷¡±× ¸ÅÄ¡¿¡¼­ ±ê¹ß °¡Áö°í ÀÖ´Â À¯Àú Ç¥½Ã. void ClearFlagPlayer(); /// Ç÷¡±× ¸ÅÄ¡¿¡¼­ ±ê¹ß °¡Áö°í ÀÖ´Â À¯Àú Ç¥½Ã »èÁ¦. LPCTSTR GetPlayerName( unsigned long characterIndex ); protected: bool AddPlayer( unsigned int i, sUnionUserData* data ); bool DeletePlayer( unsigned int i ); bool ChangePlayer( unsigned int i0, unsigned int i1 ); void UpdateLeader(); 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 ); void UpdatePlayer( unsigned int i, unsigned long userIndex, unsigned int maxhp, unsigned int hp, float posX, float posY ); bool SetGroupList(); /// ÆÄƼUI ¸®½ºÆ®¼¼ÆÃ bool UpdateGroup( unsigned int i ); /// ÆÄƼUI Á¤º¸ °»½Å bool UpdateGroupBuff( unsigned int i, sInfluenceClient* data, long count ); bool UpdateGroupBuff( unsigned int i, cPlayer* player ); void UpdateMouseHover(); void UpdateMinimap(); /// hero ±×·ìÀÎÁö ÆÇ´Ü bool IsHeroGroup( int i ); /// hero ±×·ì Á¤º¸ º¯°æ void ChangeHeroGroup( int i ); // int FindUser( unsigned long playerIndex ); // void ShowStateUI( int i ); void HideStateUI( int i ); public: static cPartyUnionManager* GetSingleton(); private: unsigned long mIndex; /// ÆÄƼÀå À¯Àú À妽º unsigned long mLeaderIndex; /// ÆÄƼ¿ø Á¤º¸ sUnionUserData mParty[MAX_PARTYUNION]; /// HERO °¡ Æ÷ÇÔµÈ ±×·ì Á¤º¸ ePARTYUNION_GROUP mGroup; /// ¸µÅ© ¾ÆÀÌÄÜ cUnionIcon* mpLinkedIcon; // unsigned int mTempSlot; // ½Ã°£ °»½Å unsigned long mHPAccumTime; unsigned long mPosAccumTime; /// ÀüÀå¿¡¼­ ¼öÀå À¯Àú À妽º unsigned long mPvpLeaderIndex; /// Ç÷¡±× ¸ÅÄ¡¿¡¼­ ±ê¹ßÀ» °¡Áø À¯Àú À妽º unsigned long mFlagPlayerIndex; }; inline sUnionUserData* cPartyUnionManager::GetData( int i ) { if( i < 0 || i >= MAX_PARTYUNION ) { assert(0); return 0; } return &mParty[i]; } inline cPartyUnionManager* cPartyUnionManager::GetSingleton() { return mpSingleton; } #define PARTYUNIONMAN cPartyUnionManager::GetSingleton()