RTSEngine.Data.GameState.UpdateActiveTeams C# (CSharp) 메소드

UpdateActiveTeams() 공개 메소드

public UpdateActiveTeams ( ) : void
리턴 void
        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]);
            }
        }

Usage Example

예제 #1
0
        public static void BuildLocal(GameState state, EngineLoadData eld, DirectoryInfo root, Dictionary<string, FileInfo> races)
        {
            // Copy Over All The Scripts
            foreach(KeyValuePair<string, ReflectedScript> kv in Scripts)
                state.Scripts.Add(kv.Key, kv.Value);

            // Load The Map
            BuildMap(state, eld.MapFile);

            BuildTeams(state, eld, races);
            state.UpdateActiveTeams();

            // Hook Building Spawn Events To Collision Grid
            foreach(var team in (from t in state.activeTeams select t.Team)) {
                team.OnBuildingSpawn += state.CGrid.OnBuildingSpawn;
            }
        }
All Usage Examples Of RTSEngine.Data.GameState::UpdateActiveTeams