示例#1
0
        /// <summary>
        /// Load all the mapsets for the game
        /// </summary>
        /// <param name="isReload">True if the mapstes are being reloaded, or false otherwise</param>
        private void LoadMapsets(bool isReload)
        {
            // Clear the existing mapsets
            MapSets.Clear();

            // Load all the default mapsets
            string[] maps = new string[] { "Beginner.mps", "Intermediate.mps" };
            foreach (string map in maps)
            {
                MapSets.Add(new MapSet(map, true));
            }

            // Load all the directory mapsets
            if (Directory.Exists("Mapsets"))
            {
                foreach (string filepath in Directory.GetFiles("Mapsets"))
                {
                    string filename = filepath.Split('\\').Last();
                    if (filename.EndsWith(".mps"))
                    {
                        MapSets.Add(new MapSet(filename, false));
                    }
                }
            }

            // Load the high scores
            Deserialize(!isReload);
        }