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


C++ CSelectedUnits::insert方法代码示例

本文整理汇总了C++中CSelectedUnits::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ CSelectedUnits::insert方法的具体用法?C++ CSelectedUnits::insert怎么用?C++ CSelectedUnits::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CSelectedUnits的用法示例。


在下文中一共展示了CSelectedUnits::insert方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AddUnit

void CSelectedUnits::AddUnit(CUnit* unit)
{
	// if unit is being transported by eg. Hulk or Atlas
	// then we should not be able to select it
	CTransportUnit *trans=unit->GetTransporter();
	if (trans != NULL && !trans->unitDef->isFirePlatform) {
		return;
	}

	if (unit->noSelect) {
		return;
	}

	GML_RECMUTEX_LOCK(sel); // AddUnit

	selectedUnits.insert(unit);
	AddDeathDependence(unit);
	selectionChanged = true;
	possibleCommandsChanged = true;

	if (!(unit->group) || unit->group->id != selectedGroup)
		selectedGroup = -1;

	unit->commandAI->selected = true;
}
开发者ID:Gepard,项目名称:spring,代码行数:25,代码来源:SelectedUnits.cpp

示例2: AddUnit

void CSelectedUnits::AddUnit(CUnit* unit)
{
	// if unit is being transported by eg. Hulk or Atlas
	// then we should not be able to select it
	if (unit->transporter != NULL && !unit->transporter->unitDef->isFirePlatform) {
		return;
	}

	if (unit->noSelect) {
		return;
	}

	selectedUnits.insert(unit);
	AddDeathDependence(unit);
	selectionChanged = true;
	possibleCommandsChanged = true;

	if (!(unit->group) || unit->group->id != selectedGroup)
		selectedGroup = -1;

	PUSH_CODE_MODE;
	ENTER_MIXED;
	unit->commandAI->selected = true;
	POP_CODE_MODE;
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:25,代码来源:SelectedUnits.cpp

示例3: AddUnit

void CSelectedUnits::AddUnit(CUnit* unit)
{
	selectedUnits.insert(unit);
	AddDeathDependence(unit);
	selectionChanged=true;
	possibleCommandsChanged=true;
	if(!(unit->group) || unit->group->id != selectedGroup)
		selectedGroup=-1;
	PUSH_CODE_MODE;
	ENTER_MIXED;
	unit->commandAI->selected=true;
	POP_CODE_MODE;
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:13,代码来源:SelectedUnits.cpp

示例4: SelectGroup

void CSelectedUnits::SelectGroup(int num)
{
	ClearSelected();
	selectedGroup=num;
	CGroup* group=grouphandler->groups[num];

	set<CUnit*>::iterator ui;
	ENTER_MIXED;
	for(ui=group->units.begin();ui!=group->units.end();++ui){
		(*ui)->commandAI->selected=true;
		selectedUnits.insert(*ui);
		AddDeathDependence(*ui);
	}
	ENTER_UNSYNCED;

	possibleCommandsChanged=true;
	selectionChanged=true;
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:18,代码来源:SelectedUnits.cpp

示例5: SelectGroup

void CSelectedUnits::SelectGroup(int num)
{
	GML_RECMUTEX_LOCK(grpsel); // SelectGroup - not needed? only reading group

	ClearSelected();
	selectedGroup=num;
	CGroup* group=grouphandlers[gu->myTeam]->groups[num];

	CUnitSet::iterator ui;
	for (ui = group->units.begin(); ui != group->units.end(); ++ui) {
		if (!(*ui)->noSelect) {
			(*ui)->commandAI->selected = true;
			selectedUnits.insert(*ui);
			AddDeathDependence(*ui);
		}
	}

	selectionChanged = true;
	possibleCommandsChanged = true;
}
开发者ID:lordelven,项目名称:spring,代码行数:20,代码来源:SelectedUnits.cpp


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