本文整理汇总了C++中CBattleEntity::getZone方法的典型用法代码示例。如果您正苦于以下问题:C++ CBattleEntity::getZone方法的具体用法?C++ CBattleEntity::getZone怎么用?C++ CBattleEntity::getZone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBattleEntity
的用法示例。
在下文中一共展示了CBattleEntity::getZone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WBUFW
CPartyDefinePacket::CPartyDefinePacket(CParty* PParty)
{
this->type = 0xC8;
this->size = 0x7C;
//party is an alliance do the double loop
if (PParty != NULL)
{
if (PParty->m_PAlliance!= NULL)
{
uint8 offset = 0;
for (uint8 a = 0; a < PParty->m_PAlliance->partyList.size(); ++a)
{
for (uint8 i = 0; i < PParty->m_PAlliance->partyList.at(a)->members.size(); ++i)
{
CBattleEntity* PChar = PParty->m_PAlliance->partyList.at(a)->members.at(i);
WBUFL(data,12*offset+(0x08)-4) = PChar->id;
WBUFW(data,12*offset+(0x0C)-4) = PChar->targid;
WBUFW(data,12*offset+(0x0E)-4) = PChar->PParty->GetMemberFlags(PChar);
WBUFW(data,12*offset+(0x10)-4) = PChar->getZone();
offset++;
}
}
}
else //regular party
{
DSP_DEBUG_BREAK_IF(PParty->members.size() > 6);
for (uint8 i = 0; i < PParty->members.size(); ++i)
{
CBattleEntity* PChar = PParty->members.at(i);
WBUFL(data,12*i+(0x08)-4) = PChar->id;
WBUFW(data,12*i+(0x0C)-4) = PChar->targid;
WBUFW(data,12*i+(0x0E)-4) = PChar->PParty->GetMemberFlags(PChar);
WBUFW(data,12*i+(0x10)-4) = PChar->getZone();
}
}
}
}
示例2: GetHighestEnmity
CBattleEntity* CEnmityContainer::GetHighestEnmity()
{
if (m_EnmityList.empty())
{
return nullptr;
}
uint32 HighestEnmity = 0;
auto highest = m_EnmityList.end();
bool active = false;
for (auto it = m_EnmityList.begin(); it != m_EnmityList.end(); ++it)
{
const EnmityObject_t& PEnmityObject = it->second;
uint32 Enmity = PEnmityObject.CE + PEnmityObject.VE;
if (Enmity >= HighestEnmity && ((PEnmityObject.active == active) || (PEnmityObject.active && !active)))
{
auto POwner = PEnmityObject.PEnmityOwner;
if (!POwner || (POwner->allegiance != m_EnmityHolder->allegiance))
{
active = PEnmityObject.active;
HighestEnmity = Enmity;
highest = it;
}
}
}
CBattleEntity* PEntity = nullptr;
if (highest != m_EnmityList.end())
{
PEntity = highest->second.PEnmityOwner;
if (!PEntity)
{
PEntity = zoneutils::GetChar(highest->first);
}
if (!PEntity || PEntity->getZone() != m_EnmityHolder->getZone() ||
PEntity->PInstance != m_EnmityHolder->PInstance)
{
m_EnmityList.erase(highest);
PEntity = GetHighestEnmity();
}
}
return PEntity;
}