void Team::statusCount(int32_t* statusTally) { //---------------------------------------------------------- // statusTally counts the number of objects in the team with // each of the statuses... for(size_t i = 0; i < rosterSize; i++) { MoverPtr obj = (MoverPtr)ObjectManager->getByWatchID(roster[i]); Assert(obj != nullptr, i, " Team.statusCount: nullptr roster object "); MechWarriorPtr pilot = obj->getPilot(); if(!obj->getExists()) statusTally[8]++; else if(!obj->getAwake()) statusTally[7]++; else if(pilot && (pilot->getStatus() == WARRIOR_STATUS_WITHDRAWN)) statusTally[6]++; else { int32_t status = obj->getStatus(); if((status < 0) || (status > 5)) Fatal(status, " Status out of bounds "); statusTally[obj->getStatus()]++; } } }
void MoverGroup::statusCount (long* statusTally) { for (long i = 0; i < numMovers; i++) { MoverPtr mover = getMover(i); MechWarriorPtr pilot = mover->getPilot(); if (!mover->getExists()) statusTally[8]++; else if (!mover->getAwake()) statusTally[7]++; else if (pilot && (pilot->getStatus() == WARRIOR_STATUS_WITHDRAWN)) statusTally[6]++; else statusTally[mover->getStatus()]++; } }