Esempio n. 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;
            }
        }
Esempio n. 2
0
        private static void BuildTeams(GameState state, EngineLoadData eld, Dictionary <string, FileInfo> races)
        {
            RTSTeam team;

            for (int i = 0; i < eld.Teams.Length; i++)
            {
                TeamInitOption res = eld.Teams[i];
                if (res.InputType == RTSInputType.None)
                {
                    continue;
                }
                team             = new RTSTeam(i, res.InputType);
                team.ColorScheme = res.Colors;
                team.Race        = RTSRaceParser.Parse(races[res.Race], state.Scripts);
                state.teams[i]   = team;
            }
        }
Esempio n. 3
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;
            }
        }
Esempio n. 4
0
 private static void BuildTeams(GameState state, EngineLoadData eld, Dictionary<string, FileInfo> races)
 {
     RTSTeam team;
     for(int i = 0; i < eld.Teams.Length; i++) {
         TeamInitOption res = eld.Teams[i];
         if(res.InputType == RTSInputType.None)
             continue;
         team = new RTSTeam(i, res.InputType);
         team.ColorScheme = res.Colors;
         team.Race = RTSRaceParser.Parse(races[res.Race], state.Scripts);
         state.teams[i] = team;
     }
 }