public void UpdateActiveTeams() { int c = 0; foreach (var team in teams) { if (team != null) { c++; } } activeTeams = new IndexedTeam[c]; c = 0; for (int i = 0; i < MAX_PLAYERS; i++) { if (teams[i] != null) { activeTeams[c++] = new IndexedTeam(i, teams[i]); } } }
public void UpdateActiveTeams() { int c = 0; foreach(var team in teams) { if(team != null) c++; } activeTeams = new IndexedTeam[c]; c = 0; for(int i = 0; i < MAX_PLAYERS; i++) { if(teams[i] != null) activeTeams[c++] = new IndexedTeam(i, teams[i]); } }