本文整理汇总了C++中ObjectBase::destroy方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectBase::destroy方法的具体用法?C++ ObjectBase::destroy怎么用?C++ ObjectBase::destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectBase
的用法示例。
在下文中一共展示了ObjectBase::destroy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setType
void Tile::setType(int newType) {
type = newType;
destroyedStructureTile = DestroyedStructure_None;
if (type == Terrain_Spice) {
spice = currentGame->randomGen.rand(RANDOMSPICEMIN, RANDOMSPICEMAX);
} else if (type == Terrain_ThickSpice) {
spice = currentGame->randomGen.rand(RANDOMTHICKSPICEMIN, RANDOMTHICKSPICEMAX);
} else if (type == Terrain_Dunes) {
} else {
spice = 0;
if (isRock()) {
sandRegion = NONE;
if (hasAnUndergroundUnit()) {
ObjectBase* current;
std::list<Uint32>::const_iterator iter;
iter = assignedUndergroundUnitList.begin();
do {
current = currentGame->getObjectManager().getObject(*iter);
++iter;
if(current == NULL)
continue;
unassignUndergroundUnit(current->getObjectID());
current->destroy();
} while(iter != assignedUndergroundUnitList.end());
}
if(type == Terrain_Mountain) {
if(hasANonInfantryGroundObject()) {
ObjectBase* current;
std::list<Uint32>::const_iterator iter;
iter = assignedNonInfantryGroundObjectList.begin();
do {
current = currentGame->getObjectManager().getObject(*iter);
++iter;
if(current == NULL)
continue;
unassignNonInfantryGroundObject(current->getObjectID());
current->destroy();
} while(iter != assignedNonInfantryGroundObjectList.end());
}
}
}
}
for (int i=location.x; i <= location.x+3; i++) {
for (int j=location.y; j <= location.y+3; j++) {
if (currentGameMap->tileExists(i, j)) {
currentGameMap->getTile(i, j)->clearTerrain();
}
}
}
}