本文整理汇总了C++中MechWarriorPtr::setMovePathRequest方法的典型用法代码示例。如果您正苦于以下问题:C++ MechWarriorPtr::setMovePathRequest方法的具体用法?C++ MechWarriorPtr::setMovePathRequest怎么用?C++ MechWarriorPtr::setMovePathRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MechWarriorPtr
的用法示例。
在下文中一共展示了MechWarriorPtr::setMovePathRequest方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: remove
PathQueueRecPtr MovePathManager::remove(MechWarriorPtr pilot)
{
PathQueueRecPtr rec = pilot->getMovePathRequest();
if(rec)
{
remove(rec);
pilot->setMovePathRequest(nullptr);
return(rec);
}
return(nullptr);
}
示例2: calcPath
void MovePathManager::calcPath(void)
{
if(queueFront)
{
//------------------------------
// Grab the next in the queue...
PathQueueRecPtr curQRec = queueFront;
remove(queueFront);
//--------------------------------------------------
// If the mover is no longer around, don't bother...
MechWarriorPtr pilot = curQRec->pilot;
pilot->setMovePathRequest(nullptr);
MoverPtr mover = pilot->getVehicle();
if(!mover)
return;
/*int32_t err = */pilot->calcMovePath(curQRec->selectionIndex, curQRec->moveParams);
}
}
示例3: 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;
}