Example #1
0
        public static void SearchAllInitInfo(DirectoryInfo dir, Dictionary <string, FileInfo> races, Dictionary <string, RTSColorScheme> dictSchemes)
        {
            var files = dir.GetFiles();

            foreach (var file in files)
            {
                if (file.Extension.ToLower().EndsWith("race"))
                {
                    races.Add(RTSRaceParser.ParseName(file), file);
                }
                else if (file.Extension.ToLower().EndsWith("scheme"))
                {
                    object scheme = ZXParser.ParseFile(file.FullName, typeof(RTSColorScheme));
                    if (scheme != null)
                    {
                        var v = (RTSColorScheme)scheme;
                        dictSchemes.Add(v.Name, v);
                    }
                }
            }
            var dirs = dir.GetDirectories();

            foreach (var subDir in dirs)
            {
                SearchAllInitInfo(subDir, races, dictSchemes);
            }
        }
Example #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;
            }
        }