1- using MultiplayerCore . Beatmaps . Abstractions ;
2- using SongCore . Data ;
3- using System . Collections . Generic ;
4- using System . Linq ;
1+ using System . Collections . Generic ;
52using System . Threading ;
63using System . Threading . Tasks ;
4+ using MultiplayerCore . Beatmaps . Abstractions ;
5+ using MultiplayerCore . Beatmaps . Serializable ;
76using UnityEngine ;
87using static SongCore . Data . ExtraSongData ;
98
109namespace MultiplayerCore . Beatmaps
1110{
1211 /// <summary>
13- /// An <see cref="IPreviewBeatmapLevel"/> created from a local preview .
12+ /// Beatmap level data that was loaded locally by SongCore .
1413 /// </summary>
15- public class LocalBeatmapLevel : MpBeatmapLevel
14+ public class LocalBeatmapLevel : MpBeatmap
1615 {
17- public override string levelHash { get ; protected set ; }
16+ public override string LevelHash { get ; protected set ; }
1817
19- public override string songName => _preview . songName ;
20- public override string songSubName => _preview . songSubName ;
21- public override string songAuthorName => _preview . songAuthorName ;
22- public override string levelAuthorName => _preview . levelAuthorName ;
18+ public override string SongName => _localBeatmapLevel . songName ;
19+ public override string SongSubName => _localBeatmapLevel . songSubName ;
20+ public override string SongAuthorName => _localBeatmapLevel . songAuthorName ;
21+ public override string LevelAuthorName => string . Join ( ", " , _localBeatmapLevel . allMappers ) ;
2322
24- public override float beatsPerMinute => _preview . beatsPerMinute ;
25- public override float songDuration => _preview . songDuration ;
26- public override float previewStartTime => _preview . previewStartTime ;
27- public override float previewDuration => _preview . previewDuration ;
28- public override EnvironmentInfoSO [ ] environmentInfos => _preview . environmentInfos ;
29- public override IReadOnlyList < PreviewDifficultyBeatmapSet > ? previewDifficultyBeatmapSets => _preview . previewDifficultyBeatmapSets ;
30-
31- public override Dictionary < string , Dictionary < BeatmapDifficulty , string [ ] > > requirements
23+ public override float BeatsPerMinute => _localBeatmapLevel . beatsPerMinute ;
24+ public override float SongDuration => _localBeatmapLevel . songDuration ;
25+
26+ public override Dictionary < string , Dictionary < BeatmapDifficulty , string [ ] > > Requirements
3227 {
3328 get
3429 {
3530 Dictionary < string , Dictionary < BeatmapDifficulty , string [ ] > > reqs = new ( ) ;
36- var difficulties = SongCore . Collections . RetrieveExtraSongData ( levelHash ) ? . _difficulties ;
31+ var difficulties = SongCore . Collections . RetrieveExtraSongData ( LevelHash ) ? . _difficulties ;
3732 if ( difficulties == null )
3833 return new ( ) ;
3934 foreach ( var difficulty in difficulties )
@@ -46,12 +41,12 @@ public override Dictionary<string, Dictionary<BeatmapDifficulty, string[]>> requ
4641 }
4742 }
4843
49- public override Dictionary < string , Dictionary < BeatmapDifficulty , DifficultyColors > > difficultyColors
44+ public override Dictionary < string , Dictionary < BeatmapDifficulty , DifficultyColors > > DifficultyColors
5045 {
5146 get
5247 {
5348 Dictionary < string , Dictionary < BeatmapDifficulty , DifficultyColors > > colors = new ( ) ;
54- var difficulties = SongCore . Collections . RetrieveExtraSongData ( levelHash ) ? . _difficulties ;
49+ var difficulties = SongCore . Collections . RetrieveExtraSongData ( LevelHash ) ? . _difficulties ;
5550 if ( difficulties == null )
5651 return new ( ) ;
5752 foreach ( var difficulty in difficulties )
@@ -65,17 +60,17 @@ public override Dictionary<string, Dictionary<BeatmapDifficulty, DifficultyColor
6560 }
6661 }
6762
68- public override Contributor [ ] contributors => SongCore . Collections . RetrieveExtraSongData ( levelHash ) ? . contributors ?? new Contributor [ 0 ] ;
63+ public override Contributor [ ] Contributors => SongCore . Collections . RetrieveExtraSongData ( LevelHash ) ? . contributors ?? new Contributor [ 0 ] ;
6964
70- private readonly IPreviewBeatmapLevel _preview ;
65+ private readonly BeatmapLevel _localBeatmapLevel ;
7166
72- public LocalBeatmapLevel ( string hash , IPreviewBeatmapLevel preview )
67+ public LocalBeatmapLevel ( string hash , BeatmapLevel localBeatmapLevel )
7368 {
74- levelHash = hash ;
75- _preview = preview ;
69+ LevelHash = hash ;
70+ _localBeatmapLevel = localBeatmapLevel ;
7671 }
7772
78- public override Task < Sprite > GetCoverImageAsync ( CancellationToken cancellationToken )
79- => _preview . GetCoverImageAsync ( cancellationToken ) ;
73+ public override Task < Sprite > TryGetCoverSpriteAsync ( CancellationToken cancellationToken )
74+ => _localBeatmapLevel . previewMediaData . GetCoverSpriteAsync ( cancellationToken ) ;
8075 }
8176}
0 commit comments