本文整理汇总了C++中Floor::getTransferRight方法的典型用法代码示例。如果您正苦于以下问题:C++ Floor::getTransferRight方法的具体用法?C++ Floor::getTransferRight怎么用?C++ Floor::getTransferRight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Floor
的用法示例。
在下文中一共展示了Floor::getTransferRight方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
CCArray *Building::getTransferFloors(){
CCArray *transferFloors = CCArray::create();
for(int i = 0; i < this->arrayFloors->count(); i++){
Floor *floor = (Floor *)this->arrayFloors->objectAtIndex(i);
if(floor->getTransferLeft() || floor->getTransferRight()){
transferFloors->addObject(floor);
}
}
return transferFloors;
}
示例2: abs
Floor *Building::findNearestTransferRightFloor(int actualFloorNumber){
CCArray *transferFloors = this->getTransferFloors();
Floor *actualFloor = NULL;
int actualDiff = 99;
for(int i = 0; i < transferFloors->count(); i++){
Floor *floor = (Floor *)transferFloors->objectAtIndex(i);
if(floor->getTransferRight()){
int floorNumber = floor->getFloorNumber();
int diff = abs(actualFloorNumber - floorNumber);
if(diff < actualDiff){
actualDiff = diff;
actualFloor = floor;
}
}
}
return actualFloor;
}