Ejemplo n.º 1
0
        /// <summary>
        /// Applies and stores sorting of a provided list of levels.
        /// </summary>
        /// <param name="levels">An enumerable containing the levels to sort.</param>
        /// <returns>Returns this instance.</returns>
        public IBeatmapLevelPack SetupFromLevels(IEnumerable <IPreviewBeatmapLevel> levels)
        {
            packID        = CustomLevelLoader.kCustomLevelPackPrefixId + PackIDSuffix;
            packName      = PackName;
            shortPackName = PackIDSuffix;
            coverImage    = UIUtilities.DefaultCoverImage;

            _beatmapLevelCollection.SetPrivateField("_levels", SongSortModule.SortSongs(levels), typeof(BeatmapLevelCollection));

            return(this);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Applies and stores sorting of a provided <see cref="IAnnotatedBeatmapLevelCollection"/>.
        /// </summary>
        /// <param name="levelCollection">A level collection to sort.</param>
        /// <returns>Returns itself if not using the non-default sort mode, otherwise returns the provided level pack.</returns>
        public IBeatmapLevelPack SetupFromLevelCollection(IAnnotatedBeatmapLevelCollection levelCollection)
        {
            if (levelCollection is IBeatmapLevelPack levelPack)
            {
                return(SetupFromLevelPack(levelPack));
            }

            packID        = CustomLevelLoader.kCustomLevelPackPrefixId + PackIDSuffix;
            packName      = PackName;
            shortPackName = levelCollection.collectionName + PackIDSuffix;
            coverImage    = levelCollection.coverImage;

            _beatmapLevelCollection.SetPrivateField("_levels", SongSortModule.SortSongs(levelCollection.beatmapLevelCollection.beatmapLevels), typeof(BeatmapLevelCollection));

            return(this);
        }
        /// <summary>
        /// Applies and stores sorting of a provided IBeatmapLevelPack.
        /// </summary>
        /// <param name="levelPack">A level pack to sort.</param>
        /// <returns>Returns itself if not using the non-default sort mode, otherwise returns the provided level pack.</returns>
        public IBeatmapLevelPack SetupFromLevelPack(IBeatmapLevelPack levelPack)
        {
            if (SongSortModule.IsDefaultSort)
            {
                return(levelPack);
            }

            packID        = levelPack.packID + PackIDSuffix;
            packName      = levelPack.packName;
            shortPackName = levelPack.shortPackName;
            coverImage    = levelPack.coverImage;

            _beatmapLevelCollection.SetPrivateField("_levels", SongSortModule.SortSongs(levelPack.beatmapLevelCollection.beatmapLevels), typeof(BeatmapLevelCollection));

            return(this);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Applies and stores sorting of a provided <see cref="IBeatmapLevelPack"/>.
        /// </summary>
        /// <param name="levelPack">A level pack to sort.</param>
        /// <returns>Returns itself if not using the non-default sort mode, otherwise returns the provided level pack.</returns>
        private IBeatmapLevelPack SetupFromLevelPack(IBeatmapLevelPack levelPack)
        {
            if (SongSortModule.IsDefaultSort)
            {
                return(levelPack);
            }

            packID = levelPack.packID + PackIDSuffix;
            if (!packID.StartsWith(CustomLevelLoader.kCustomLevelPackPrefixId))
            {
                packID = CustomLevelLoader.kCustomLevelPackPrefixId + packID;
            }

            packName      = levelPack.packName;
            shortPackName = levelPack.shortPackName + PackIDSuffix;
            coverImage    = levelPack.coverImage;

            _beatmapLevelCollection.SetPrivateField("_levels", SongSortModule.SortSongs(levelPack.beatmapLevelCollection.beatmapLevels), typeof(BeatmapLevelCollection));

            return(this);
        }