本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}