本文整理汇总了C++中CreatureList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ CreatureList::push_back方法的具体用法?C++ CreatureList::push_back怎么用?C++ CreatureList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CreatureList
的用法示例。
在下文中一共展示了CreatureList::push_back方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MoveInLineOfSight
void MoveInLineOfSight(Unit* pWho) override
{
if (HasEscortState(STATE_ESCORT_ESCORTING) && pWho->GetEntry() == NPC_REETHE && lCreatureList.empty())
lCreatureList.push_back((Creature*)pWho);
npc_escortAI::MoveInLineOfSight(pWho);
}
示例2: GetClosestDwarfNotInCombat
Creature* instance_uldaman::GetClosestDwarfNotInCombat(Creature* pSearcher)
{
CreatureList lTemp;
for (GuidList::const_iterator itr = m_lWardens.begin(); itr != m_lWardens.end(); ++itr)
{
Creature* pTemp = instance->GetCreature(*itr);
if (pTemp && pTemp->isAlive() && !pTemp->getVictim())
lTemp.push_back(pTemp);
}
if (lTemp.empty())
return nullptr;
lTemp.sort(ObjectDistanceOrder(pSearcher));
return lTemp.front();
}
示例3:
CreatureList<PrivateKey> StorageReal::getPrivateKeyList(Monitor& monitor)
{
if (!check_interface(monitor)) return CreatureList<PrivateKey>();
CreatureList<PrivateKey> res = creator.createCreatureList<PrivateKey>();
Iterator i; SIMPLE_CALL( (i=iface->iterator(session,error)) );
for (; i.inrange(); ++i)
{
eprovider::Error error;
TheKey thekey = iface->item(session,i,error);
if (thekey.category() == kcPrivateKey)
{
PrivateKey toadd = creator.createPrivateKey(thekey,NotCritical(monitor));
if (toadd) res.push_back( toadd );
}
}
return res;
}
示例4: JustSummoned
void JustSummoned(Creature* pSummoned) override
{
lCreatureList.push_back(pSummoned);
pSummoned->setFaction(FACTION_GENERIC_FRIENDLY);
if (pSummoned->GetEntry() == NPC_CALDWELL)
pSummoned->GetMotionMaster()->MovePoint(0, m_afMoveTo[0], m_afMoveTo[1], m_afMoveTo[2]);
else
{
if (Creature* pCaldwell = GetCreature(NPC_CALDWELL))
{
// will this conversion work without compile warning/error?
size_t iSize = lCreatureList.size();
pSummoned->GetMotionMaster()->MoveFollow(pCaldwell, 0.5f, (M_PI / 2) * (int)iSize);
}
}
}
示例5: DoPrepareChessEvent
void instance_karazhan::DoPrepareChessEvent()
{
// Allow all the chess pieces to init start position
for (GuidList::const_iterator itr = m_lChessPiecesAlliance.begin(); itr != m_lChessPiecesAlliance.end(); ++itr)
{
if (Creature* pChessPiece = instance->GetCreature(*itr))
{
Creature* pSquare = GetClosestCreatureWithEntry(pChessPiece, NPC_SQUARE_BLACK, 2.0f);
if (!pSquare)
pSquare = GetClosestCreatureWithEntry(pChessPiece, NPC_SQUARE_WHITE, 2.0f);
if (!pSquare)
{
script_error_log("Instance Karazhan: ERROR Failed to properly load the Chess square for %s.", pChessPiece->GetGuidStr().c_str());
return;
}
// send event which will prepare the current square
pChessPiece->AI()->SendAIEvent(AI_EVENT_CUSTOM_B, pSquare, pChessPiece);
}
}
for (GuidList::const_iterator itr = m_lChessPiecesHorde.begin(); itr != m_lChessPiecesHorde.end(); ++itr)
{
if (Creature* pChessPiece = instance->GetCreature(*itr))
{
Creature* pSquare = GetClosestCreatureWithEntry(pChessPiece, NPC_SQUARE_BLACK, 2.0f);
if (!pSquare)
pSquare = GetClosestCreatureWithEntry(pChessPiece, NPC_SQUARE_WHITE, 2.0f);
if (!pSquare)
{
script_error_log("Instance Karazhan: ERROR Failed to properly load the Chess square for %s.", pChessPiece->GetGuidStr().c_str());
return;
}
// send event which will prepare the current square
pChessPiece->AI()->SendAIEvent(AI_EVENT_CUSTOM_B, pSquare, pChessPiece);
}
}
// add silence debuff
Map::PlayerList const& players = instance->GetPlayers();
for (const auto& player : players)
{
if (Player* pPlayer = player.getSource())
pPlayer->CastSpell(pPlayer, SPELL_GAME_IN_SESSION, TRIGGERED_OLD_TRIGGERED);
}
m_uiAllianceStalkerCount = 0;
m_uiHordeStalkerCount = 0;
m_vHordeStalkers.clear();
m_vAllianceStalkers.clear();
// sort stalkers depending on side
CreatureList lStalkers;
for (GuidList::const_iterator itr = m_lChessHordeStalkerList.begin(); itr != m_lChessHordeStalkerList.end(); ++itr)
{
if (Creature* pTemp = instance->GetCreature(*itr))
lStalkers.push_back(pTemp);
}
if (lStalkers.empty())
{
script_error_log("Instance Karazhan: ERROR Failed to properly load the horde side stalkers for the Chess Event.");
return;
}
// get the proper statusBar npc
Creature* pStatusBar = instance->GetCreature(m_HordeStatusGuid);
if (!pStatusBar)
return;
lStalkers.sort(ObjectDistanceOrder(pStatusBar));
for (CreatureList::const_iterator itr = lStalkers.begin(); itr != lStalkers.end(); ++itr)
m_vHordeStalkers.push_back((*itr)->GetObjectGuid());
lStalkers.clear();
for (GuidList::const_iterator itr = m_lChessAllianceStalkerList.begin(); itr != m_lChessAllianceStalkerList.end(); ++itr)
{
if (Creature* pTemp = instance->GetCreature(*itr))
lStalkers.push_back(pTemp);
}
if (lStalkers.empty())
{
script_error_log("Instance Karazhan: ERROR Failed to properly load the alliance side stalkers for the Chess Event.");
return;
}
// get the proper statusBar npc
pStatusBar = instance->GetCreature(m_AllianceStatusGuid);
if (!pStatusBar)
return;
lStalkers.sort(ObjectDistanceOrder(pStatusBar));
for (CreatureList::const_iterator itr = lStalkers.begin(); itr != lStalkers.end(); ++itr)
m_vAllianceStalkers.push_back((*itr)->GetObjectGuid());
}