コード例 #1
0
        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]);
                }
            }
        }
コード例 #2
0
ファイル: GameState.cs プロジェクト: RegrowthStudios/VoxelRTS
 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]);
     }
 }