private string GenerateList(Collections collections,
                                    CollectionListSaveType listType = CollectionListSaveType.Txt,
                                    BeatmapListType beatmapListType = BeatmapListType.All)
        {
            if (collections == null)
            {
                return("");
            }
            var generator = _listGenerators[listType];

            generator.StartGenerating();

            _stringBuilder.Clear();
            _stringBuilder.Append(generator.GetListHeader(collections));
            for (int i = 0; i < collections.Count; i++)
            {
                var mapSets = collections[i].GetMapSets(beatmapListType);
                _stringBuilder.Append(
                    generator.GetCollectionBody(collections[i], mapSets, i)
                    );
            }
            _stringBuilder.Append(generator.GetListFooter(collections));

            generator.EndGenerating();


            return(_stringBuilder.ToString());
        }
Beispiel #2
0
        internal static Dictionary <int, Beatmaps> GetMapSets(this Collection collection, BeatmapListType beatmapListType)
        {
            var mapSets = new Dictionary <int, Beatmaps>();

            switch (beatmapListType)
            {
            case BeatmapListType.All:
                mapSets = collection.GetBeatmapSets();
                break;

            case BeatmapListType.NotKnown:
                mapSets = CollectionUtils.GetBeatmapSets(collection.NotKnownBeatmaps());
                break;

            case BeatmapListType.Known:
                mapSets = CollectionUtils.GetBeatmapSets(collection.KnownBeatmaps);
                break;

            case BeatmapListType.Downloadable:
                mapSets = CollectionUtils.GetBeatmapSets(collection.DownloadableBeatmaps);
                break;
            }
            return(mapSets);
        }