本文整理汇总了C++中ObjectBase::isSelectedByOtherPlayer方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectBase::isSelectedByOtherPlayer方法的具体用法?C++ ObjectBase::isSelectedByOtherPlayer怎么用?C++ ObjectBase::isSelectedByOtherPlayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectBase
的用法示例。
在下文中一共展示了ObjectBase::isSelectedByOtherPlayer方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: blitSelectionRects
void Tile::blitSelectionRects(int xPos, int yPos) {
// draw underground selection rectangles
if(hasAnUndergroundUnit() && !isFogged(pLocalHouse->getHouseID())) {
UnitBase* current = getUndergroundUnit();
if(current != NULL) {
if(current->isVisible(pLocalHouse->getTeam()) && (location == current->getLocation())) {
if(current->isSelected()) {
current->drawSelectionBox();
}
if(current->isSelectedByOtherPlayer()) {
current->drawOtherPlayerSelectionBox();
}
}
}
}
// draw infantry selection rectangles
if(hasInfantry() && !isFogged(pLocalHouse->getHouseID())) {
std::list<Uint32>::const_iterator iter;
for(iter = assignedInfantryList.begin(); iter != assignedInfantryList.end() ; ++iter) {
InfantryBase* current = dynamic_cast<InfantryBase*>(currentGame->getObjectManager().getObject(*iter));
if(current == NULL) {
continue;
}
if(current->isVisible(pLocalHouse->getTeam()) && (location == current->getLocation())) {
if(current->isSelected()) {
current->drawSelectionBox();
}
if(current->isSelectedByOtherPlayer()) {
current->drawOtherPlayerSelectionBox();
}
}
}
}
// draw non infantry ground object selection rectangles
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 == NULL) {
continue;
}
if(current->isVisible(pLocalHouse->getTeam()) && (location == current->getLocation())) {
if(current->isSelected()) {
current->drawSelectionBox();
}
if(current->isSelectedByOtherPlayer()) {
current->drawOtherPlayerSelectionBox();
}
}
}
}
// draw air unit selection rectangles
if(hasAnAirUnit() && !isFogged(pLocalHouse->getHouseID())) {
std::list<Uint32>::const_iterator iter;
for(iter = assignedAirUnitList.begin(); iter != assignedAirUnitList.end() ; ++iter) {
AirUnit* airUnit = dynamic_cast<AirUnit*>(currentGame->getObjectManager().getObject(*iter));
if(airUnit == NULL) {
continue;
}
if(airUnit->isVisible(pLocalHouse->getTeam()) && (location == airUnit->getLocation())) {
if(airUnit->isSelected()) {
airUnit->drawSelectionBox();
}
if(airUnit->isSelectedByOtherPlayer()) {
airUnit->drawOtherPlayerSelectionBox();
}
}
}
}
}