public int getBotsCount ( int teamId , boolean invert ) { int total = 0 ; for ( Robot bot : robotsPosition . keySet ( ) ) { if ( bot . getData ( ) . getTeamId ( ) == teamId ) { if ( ! invert ) { total ++ ; } } else { if ( invert ) { total ++ ; } } } return total ; }
Get the total number of living robots from or not from a team