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


C++ MechWarriorPtr类代码示例

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

示例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);
	}
}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:8,代码来源:group.cpp

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

示例4: 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

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

示例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);
}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:13,代码来源:group.cpp

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


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