protected void reportWinnersAndLosers ()
{
int numPlayers = _playerOids.length;
// set up 3 sets that will not need internal expanding
ArrayIntSet winners = new ArrayIntSet(numPlayers);
ArrayIntSet losers = new ArrayIntSet(numPlayers);
ArrayIntSet places = new ArrayIntSet(numPlayers);
for (int ii=0; ii < numPlayers; ii++) {
BodyObject user = getPlayer(ii);
if (user != null) {
places.add(user.getPlaceOid());
(_gameobj.isWinner(ii) ? winners : losers).add(user.getOid());
}
}
Object[] args = new Object[] { winners.toIntArray(), losers.toIntArray() };
// now send a message event to each room
for (int ii=0, nn = places.size(); ii < nn; ii++) {
DObject place = _omgr.getObject(places.get(ii));
if (place != null) {
place.postMessage(WINNERS_AND_LOSERS, args);
}
}
}