本文整理汇总了C++中MechWarriorPtr类的典型用法代码示例。如果您正苦于以下问题:C++ MechWarriorPtr类的具体用法?C++ MechWarriorPtr怎么用?C++ MechWarriorPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MechWarriorPtr类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Assert
bool Team::isTargeting(GameObjectWatchID targetWID, GameObjectWatchID exceptWID)
{
if(exceptWID)
for(size_t i = 0; i < rosterSize; i++)
{
if(roster[i] == exceptWID)
continue;
MoverPtr mover = dynamic_cast<MoverPtr>(ObjectManager->getByWatchID(roster[i]));
Assert(mover != nullptr, roster[i], " Team.isTargeting: nullptr mover ");
MechWarriorPtr pilot = mover->getPilot();
if(pilot)
{
GameObjectPtr target = pilot->getCurrentTarget();
if(target && (target->getWatchID() == targetWID))
return(true);
}
}
else
for(size_t i = 0; i < rosterSize; i++)
{
MoverPtr mover = dynamic_cast<MoverPtr>(ObjectManager->getByWatchID(roster[i]));
Assert(mover != nullptr, roster[i], " Team.isTargeting: nullptr mover ");
MechWarriorPtr pilot = mover->getPilot();
if(pilot)
{
GameObjectPtr target = pilot->getCurrentTarget();
if(target && (target->getWatchID() == targetWID))
return(true);
}
}
return(false);
}
示例2: getMover
void MoverGroup::triggerAlarm (long alarmCode, unsigned long triggerId) {
for (long i = 0; i < numMovers; i++) {
MechWarriorPtr pilot = getMover(i)->getPilot();
if (pilot)
pilot->triggerAlarm(alarmCode, triggerId);
}
}
示例3: getMover
void MoverGroup::triggerAlarm(int32_t alarmCode, uint32_t triggerId)
{
for (size_t i = 0; i < numMovers; i++)
{
MechWarriorPtr pilot = getMover(i)->getPilot();
if (pilot)
pilot->triggerAlarm(alarmCode, triggerId);
}
}
示例4: remove
PathQueueRecPtr MovePathManager::remove(MechWarriorPtr pilot)
{
PathQueueRecPtr rec = pilot->getMovePathRequest();
if(rec)
{
remove(rec);
pilot->setMovePathRequest(nullptr);
return(rec);
}
return(nullptr);
}
示例5: Assert
int32_t MoverGroup::orderEject(int32_t origin)
{
int32_t result = TACORDER_FAILURE;
for (size_t i = 0; i < numMovers; i++)
{
Assert(getMover(i) != nullptr, 0, " MoverGroup.orderEject: nullptr mover ");
MechWarriorPtr pilot = getMover(i)->getPilot();
if (pilot)
result = pilot->orderEject(true, true, origin);
}
return (result);
}
示例6: Assert
long MoverGroup::orderWithdraw (long origin, Stuff::Vector3D location) {
long result = TACORDER_FAILURE;
for (long i = 0; i < numMovers; i++) {
Assert(getMover(i) != NULL, 0, " MoverGroup.orderWithdraw: NULL mover ");
MechWarriorPtr pilot = getMover(i)->getPilot();
if (pilot)
result = pilot->orderWithdraw(true, origin, location);
}
return(result);
}
示例7: request
void MovePathManager::request(MechWarriorPtr pilot, int32_t selectionIndex, uint32_t moveParams, int32_t source)
{
//-----------------------------------------------------
// If the pilot is already awaiting a calc, purge it...
remove(pilot);
if(!freeList)
Fatal(0, " Too many pilots calcing paths ");
//---------------------------------------------
// Grab the first free move path rec in line...
PathQueueRecPtr pathQRec = freeList;
//-----------------------------------------
// Cut the new record from the free list...
freeList = freeList->next;
if(freeList)
freeList->prev = nullptr;
//---------------------------------------------------
// New record has no next. Already has no previous...
pathQRec->num = source;
pathQRec->pilot = pilot;
pathQRec->selectionIndex = selectionIndex;
pathQRec->moveParams = moveParams;
if(queueEnd)
{
queueEnd->next = pathQRec;
pathQRec->prev = queueEnd;
pathQRec->next = nullptr;
queueEnd = pathQRec;
}
else
{
pathQRec->prev = nullptr;
pathQRec->next = nullptr;
queueFront = queueEnd = pathQRec;
}
pilot->setMovePathRequest(pathQRec);
numPaths++;
sourceTally[source]++;
if(numPaths > peakPaths)
peakPaths = numPaths;
}