Exemplo n.º 1
0
        public ENUM_RELATION GetCampType(CObject pObj_A, CObject pObj_B)
        {
            if (pObj_A == null || pObj_B == null)
            {
                return(ENUM_RELATION.RELATION_ENEMY);
            }

            if (pObj_A == pObj_B)
            {
                return(ENUM_RELATION.RELATION_FRIEND);
            }

            //      int idOwner_A, idOwner_B, idA, idB;
            //      idA			= pObj_A.ServerID;
            //      idB			= pObj_B.ServerID;
            //      idOwner_A	= pObj_A.ownerid;
            //      idOwner_B	= pObj_B->GetOwnerID();
            //      if ( idOwner_A != INVALID_ID || idOwner_B != INVALID_ID )
            //      {
            //          if ( idOwner_A == idOwner_B
            //              || idOwner_A == idB
            //              || idOwner_B == idA )
            //          {
            //              return RELATION_FRIEND;
            //          }
            //      }

            //const _CAMP_DATA *pCamp_A, *pCamp_B;
            //BOOL bHuman_A, bHuman_B;
            //const CampAndStandDataMgr_T *pCampMgr;

            //pCamp_A		= pObj_A->GetCampData();
            //pCamp_B		= pObj_B->GetCampData();
            //bHuman_A	= g_theKernel.IsKindOf( pObj_A->GetClass(), GETCLASS(CObject_PlayerMySelf));
            //bHuman_B	= g_theKernel.IsKindOf( pObj_B->GetClass(), GETCLASS(CObject_PlayerMySelf));
            //pCampMgr	= CGameProcedure::s_pCampDataMgr;

            _CAMP_DATA cap_a = pObj_A.GetCampData();
            _CAMP_DATA cap_b = pObj_B.GetCampData();

            return(CampStand.Instance.CalcRelationType(cap_a.m_nCampID, cap_b.m_nCampID));
        }