Пример #1
0
        private static IEnumerable <Tuple <string, StoryBoard> > LoadStoryboards(MapsetMergerVm.MapsetItem mapset)
        {
            // Check storyboard count not over the max
            // Use generator pattern

            var storyboards = Directory.GetFiles(mapset.Path, "*.osb", SearchOption.AllDirectories).ToList();

            if (storyboards.Count > MaxMapsetMaps)
            {
                throw new Exception("Storyboard limit exceeded in mapset: " + mapset.Name);
            }

            foreach (var path in storyboards)
            {
                yield return(new Tuple <string, StoryBoard>(path, new StoryboardEditor(path).StoryBoard));
            }
        }
Пример #2
0
        private static IEnumerable <Tuple <string, Beatmap> > LoadBeatmaps(MapsetMergerVm.MapsetItem mapset)
        {
            // Check map count not over the max
            // Use generator pattern

            var beatmaps = Directory.GetFiles(mapset.Path, "*.osu", SearchOption.AllDirectories).ToList();

            if (beatmaps.Count > MaxMapsetMaps)
            {
                throw new Exception("Beatmap limit exceeded in mapset: " + mapset.Name);
            }

            foreach (var path in beatmaps)
            {
                yield return(new Tuple <string, Beatmap>(path, new BeatmapEditor(path).Beatmap));
            }
        }