本文整理汇总了C++中ObjectBase::isAUnit方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectBase::isAUnit方法的具体用法?C++ ObjectBase::isAUnit怎么用?C++ ObjectBase::isAUnit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectBase
的用法示例。
在下文中一共展示了ObjectBase::isAUnit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: blitNonInfantryGroundUnits
void Tile::blitNonInfantryGroundUnits(int xPos, int yPos) {
if(hasANonInfantryGroundObject() && !isFogged(pLocalHouse->getHouseID())) {
std::list<Uint32>::const_iterator iter;
for(iter = assignedNonInfantryGroundObjectList.begin(); iter != assignedNonInfantryGroundObjectList.end() ; ++iter) {
ObjectBase* current = currentGame->getObjectManager().getObject(*iter);
if(current->isAUnit() && current->isVisible(pLocalHouse->getTeam())) {
if(location == current->getLocation()) {
current->blitToScreen();
}
}
}
}
}
示例2: getRadarColor
Uint32 Tile::getRadarColor(House* pHouse, bool radar) {
if(isExplored(pHouse->getHouseID()) || debug) {
if(isFogged(pHouse->getHouseID()) && radar) {
return fogColor;
} else {
ObjectBase* pObject = getObject();
if(pObject != NULL) {
int color;
if(pObject->getItemID() == Unit_Sandworm) {
color = COLOR_WHITE;
} else {
switch(pObject->getOwner()->getHouseID()) {
case HOUSE_HARKONNEN:
color = COLOR_HARKONNEN;
break;
case HOUSE_ATREIDES:
color = COLOR_ATREIDES;
break;
case HOUSE_ORDOS:
color = COLOR_ORDOS;
break;
case HOUSE_FREMEN:
color = COLOR_FREMEN;
break;
case HOUSE_SARDAUKAR:
color = COLOR_SARDAUKAR;
break;
case HOUSE_MERCENARY:
color = COLOR_MERCENARY;
break;
default:
color = COLOR_BLACK;
break;
}
}
if(pObject->isAUnit()) {
fogColor = getColorByTerrainType(getType());
} else {
fogColor = color;
}
// units and structures of the enemy are not visible if no radar
if(!radar && !debug && (pObject->getOwner()->getTeam() != pHouse->getTeam())) {
return COLOR_BLACK;
} else {
return color;
}
} else {
fogColor = getColorByTerrainType(getType());
if(!radar && !debug) {
return COLOR_BLACK;
} else {
return fogColor;
}
}
}
} else {
return COLOR_BLACK;
}
}