本文整理汇总了C++中MoverPtr::getGroupId方法的典型用法代码示例。如果您正苦于以下问题:C++ MoverPtr::getGroupId方法的具体用法?C++ MoverPtr::getGroupId怎么用?C++ MoverPtr::getGroupId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MoverPtr
的用法示例。
在下文中一共展示了MoverPtr::getGroupId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setHit
void TriggerAreaManager::setHit (MoverPtr mover) {
#if 1
for (long i = 0; i < MAX_TRIGGER_AREAS; i++) {
if (triggerAreas[i].type == TRIGGER_AREA_NONE)
continue;
if (mover->cellPositionRow >= triggerAreas[i].dim[0])
if (mover->cellPositionRow < triggerAreas[i].dim[2])
if (mover->cellPositionCol >= triggerAreas[i].dim[1])
if (mover->cellPositionCol < triggerAreas[i].dim[3])
switch (triggerAreas[i].type) {
case TRIGGER_AREA_MOVER:
if (triggerAreas[i].param > 0) {
if (mover->getWatchID() == triggerAreas[i].param)
triggerAreas[i].hit = true;
}
else
triggerAreas[i].hit = true;
break;
case TRIGGER_AREA_TEAM:
if (mover->getTeamId() == triggerAreas[i].param) {
triggerAreas[i].hit = true;
//sprintf(s, "AREA HIT: %d", i);
//DEBUGWINS_print(s, 0);
}
break;
case TRIGGER_AREA_GROUP:
if (mover->getGroupId() == triggerAreas[i].param)
triggerAreas[i].hit = true;
break;
case TRIGGER_AREA_COMMANDER:
if (mover->getCommanderId() == triggerAreas[i].param)
triggerAreas[i].hit = true;
break;
}
}
#else
long areaHandle = map[mover->cellPositionRow / 3][mover->cellPositionCol / 3];
if (areaHandle > 0) {
switch (triggerAreas[areaHandle].type) {
case TRIGGER_AREA_MOVER:
if (triggerAreas[areaHandle].param > 0) {
if (mover->getWatchID() == triggerAreas[areaHandle].param)
triggerAreas[areaHandle].hit = true;
}
else
triggerAreas[areaHandle].hit = true;
break;
case TRIGGER_AREA_TEAM:
if (mover->getTeamId() == triggerAreas[areaHandle].param)
triggerAreas[areaHandle].hit = true;
break;
case TRIGGER_AREA_GROUP:
if (mover->getGroupId() == triggerAreas[areaHandle].param)
triggerAreas[areaHandle].hit = true;
break;
case TRIGGER_AREA_COMMANDER:
if (mover->getCommanderId() == triggerAreas[areaHandle].param)
triggerAreas[areaHandle].hit = true;
break;
}
}
#endif
}