当前位置: 首页>>代码示例>>C++>>正文


C++ MechWarriorPtr::setMovePathRequest方法代码示例

本文整理汇总了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);
}
开发者ID:BobrDobr69,项目名称:mechcommander2,代码行数:11,代码来源:movemgr.cpp

示例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);
    }
}
开发者ID:BobrDobr69,项目名称:mechcommander2,代码行数:18,代码来源:movemgr.cpp

示例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;
}
开发者ID:BobrDobr69,项目名称:mechcommander2,代码行数:40,代码来源:movemgr.cpp


注:本文中的MechWarriorPtr::setMovePathRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。