// --------------------------------------------------------------------- // Selects all units owned by the player of a certain propulsion type. // On Screen toggle. UDWORD selSelectAllSameProp( UDWORD player, PROPULSION_TYPE propType, BOOL bOnScreen ) { PROPULSION_STATS *psPropStats; DROID *psDroid; UDWORD count; selDroidDeselect(player); /* Go thru' them all */ for(psDroid = apsDroidLists[player], count = 0; psDroid; psDroid = psDroid->psNext) { /* Is on screen important */ if(bOnScreen ? droidOnScreen(psDroid,0) : true) { /* Get the propulsion type */ psPropStats = asPropulsionStats + psDroid->asBits[COMP_PROPULSION].nStat; ASSERT( psPropStats != NULL, "moveUpdateUnit: invalid propulsion stats pointer" ); /* Same as that asked for - don't want Transporters*/ if ( psPropStats->propulsionType == propType && psDroid->droidType != DROID_TRANSPORTER) { psDroid->selected = true; count++; } } } return(selNumSelected(player)); }
// --------------------------------------------------------------------- // Selects all units the same as the one(s) selected static unsigned int selSelectAllSame(unsigned int player, bool bOnScreen) { for (DROID *psDroid = apsDroidLists[player]; psDroid; psDroid = psDroid->psNext) { if (psDroid->selected) { selNameSelect(psDroid->aName, player, bOnScreen); } } return selNumSelected(player); }
// --------------------------------------------------------------------- // Selects all units the same as the one(s) selected UDWORD selSelectAllSame( UDWORD player, BOOL bOnScreen) { DROID *psDroid; UDWORD count; for(psDroid = apsDroidLists[player], count = 0; psDroid; psDroid = psDroid->psNext) { if(psDroid->selected) { count+=selNameSelect(psDroid->aName, player, bOnScreen); } } return(selNumSelected(player)); }
//----------------------------------------------------------------------------------- UDWORD getNumDroidsSelected( void ) { return(selNumSelected(selectedPlayer)); }