mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 15:44:04 +09:00
Merge pull request #15634 from peppy/i-working-beatmap/simple-cases
Update all simple cases of switching to `IWorkingBeatmap`
This commit is contained in:
@ -151,7 +151,7 @@ namespace osu.Game.Beatmaps
|
||||
}, token, TaskCreationOptions.HideScheduler | TaskCreationOptions.RunContinuationsAsynchronously, updateScheduler);
|
||||
}
|
||||
|
||||
public Task<List<TimedDifficultyAttributes>> GetTimedDifficultyAttributesAsync(WorkingBeatmap beatmap, Ruleset ruleset, Mod[] mods, CancellationToken token = default)
|
||||
public Task<List<TimedDifficultyAttributes>> GetTimedDifficultyAttributesAsync(IWorkingBeatmap beatmap, Ruleset ruleset, Mod[] mods, CancellationToken token = default)
|
||||
{
|
||||
return Task.Factory.StartNew(() => ruleset.CreateDifficultyCalculator(beatmap).CalculateTimed(mods),
|
||||
token,
|
||||
|
@ -179,7 +179,7 @@ namespace osu.Game.Beatmaps
|
||||
/// <summary>
|
||||
/// A default representation of a WorkingBeatmap to use when no beatmap is available.
|
||||
/// </summary>
|
||||
public WorkingBeatmap DefaultBeatmap => workingBeatmapCache.DefaultBeatmap;
|
||||
public IWorkingBeatmap DefaultBeatmap => workingBeatmapCache.DefaultBeatmap;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when a notification should be presented to the user.
|
||||
|
@ -9,9 +9,9 @@ namespace osu.Game.Beatmaps.Drawables
|
||||
{
|
||||
public class BeatmapBackgroundSprite : Sprite
|
||||
{
|
||||
private readonly WorkingBeatmap working;
|
||||
private readonly IWorkingBeatmap working;
|
||||
|
||||
public BeatmapBackgroundSprite(WorkingBeatmap working)
|
||||
public BeatmapBackgroundSprite(IWorkingBeatmap working)
|
||||
{
|
||||
if (working == null)
|
||||
throw new ArgumentNullException(nameof(working));
|
||||
|
@ -37,7 +37,7 @@ namespace osu.Game.Online.Chat
|
||||
base.LoadComplete();
|
||||
|
||||
string verb;
|
||||
BeatmapInfo beatmapInfo;
|
||||
IBeatmapInfo beatmapInfo;
|
||||
|
||||
switch (api.Activity.Value)
|
||||
{
|
||||
@ -57,7 +57,7 @@ namespace osu.Game.Online.Chat
|
||||
break;
|
||||
}
|
||||
|
||||
string beatmapString = beatmapInfo.OnlineID.HasValue ? $"[{api.WebsiteRootUrl}/b/{beatmapInfo.OnlineID} {beatmapInfo}]" : beatmapInfo.ToString();
|
||||
string beatmapString = beatmapInfo.OnlineID > 0 ? $"[{api.WebsiteRootUrl}/b/{beatmapInfo.OnlineID} {beatmapInfo}]" : beatmapInfo.ToString();
|
||||
|
||||
channelManager.PostMessage($"is {verb} {beatmapString}", true, target);
|
||||
Expire();
|
||||
|
@ -25,7 +25,7 @@ namespace osu.Game.Screens.Play
|
||||
/// </summary>
|
||||
public class BeatmapMetadataDisplay : Container
|
||||
{
|
||||
private readonly WorkingBeatmap beatmap;
|
||||
private readonly IWorkingBeatmap beatmap;
|
||||
private readonly Bindable<IReadOnlyList<Mod>> mods;
|
||||
private readonly Drawable logoFacade;
|
||||
private LoadingSpinner loading;
|
||||
@ -43,7 +43,7 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
}
|
||||
|
||||
public BeatmapMetadataDisplay(WorkingBeatmap beatmap, Bindable<IReadOnlyList<Mod>> mods, Drawable logoFacade)
|
||||
public BeatmapMetadataDisplay(IWorkingBeatmap beatmap, Bindable<IReadOnlyList<Mod>> mods, Drawable logoFacade)
|
||||
{
|
||||
this.beatmap = beatmap;
|
||||
this.logoFacade = logoFacade;
|
||||
|
@ -354,7 +354,7 @@ namespace osu.Game.Screens.Play
|
||||
private Drawable createUnderlayComponents() =>
|
||||
DimmableStoryboard = new DimmableStoryboard(Beatmap.Value.Storyboard) { RelativeSizeAxes = Axes.Both };
|
||||
|
||||
private Drawable createGameplayComponents(WorkingBeatmap working, IBeatmap playableBeatmap) => new ScalingContainer(ScalingMode.Gameplay)
|
||||
private Drawable createGameplayComponents(IWorkingBeatmap working, IBeatmap playableBeatmap) => new ScalingContainer(ScalingMode.Gameplay)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@ -372,7 +372,7 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
};
|
||||
|
||||
private Drawable createOverlayComponents(WorkingBeatmap working)
|
||||
private Drawable createOverlayComponents(IWorkingBeatmap working)
|
||||
{
|
||||
var container = new Container
|
||||
{
|
||||
|
@ -15,9 +15,9 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
internal class BeatmapInfoWedgeBackground : CompositeDrawable
|
||||
{
|
||||
private readonly WorkingBeatmap beatmap;
|
||||
private readonly IWorkingBeatmap beatmap;
|
||||
|
||||
public BeatmapInfoWedgeBackground(WorkingBeatmap beatmap)
|
||||
public BeatmapInfoWedgeBackground(IWorkingBeatmap beatmap)
|
||||
{
|
||||
this.beatmap = beatmap;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ namespace osu.Game.Screens.Select.Carousel
|
||||
{
|
||||
public class SetPanelBackground : BufferedContainer
|
||||
{
|
||||
public SetPanelBackground(WorkingBeatmap working)
|
||||
public SetPanelBackground(IWorkingBeatmap working)
|
||||
: base(cachedFrameBuffer: true)
|
||||
{
|
||||
RedrawOnScale = false;
|
||||
|
@ -671,7 +671,7 @@ namespace osu.Game.Screens.Select
|
||||
music.TrackChanged -= ensureTrackLooping;
|
||||
}
|
||||
|
||||
private void ensureTrackLooping(WorkingBeatmap beatmap, TrackChangeDirection changeDirection)
|
||||
private void ensureTrackLooping(IWorkingBeatmap beatmap, TrackChangeDirection changeDirection)
|
||||
=> beatmap.PrepareTrackForPreviewLooping();
|
||||
|
||||
public override bool OnBackButton()
|
||||
|
@ -89,7 +89,7 @@ namespace osu.Game.Storyboards
|
||||
}
|
||||
}
|
||||
|
||||
public DrawableStoryboard CreateDrawable(WorkingBeatmap working = null) =>
|
||||
public DrawableStoryboard CreateDrawable(IWorkingBeatmap working = null) =>
|
||||
new DrawableStoryboard(this);
|
||||
|
||||
public Drawable CreateSpriteFromResourcePath(string path, TextureStore textureStore)
|
||||
|
@ -27,11 +27,11 @@ namespace osu.Game.Users
|
||||
|
||||
public abstract class InGame : UserActivity
|
||||
{
|
||||
public BeatmapInfo BeatmapInfo { get; }
|
||||
public IBeatmapInfo BeatmapInfo { get; }
|
||||
|
||||
public RulesetInfo Ruleset { get; }
|
||||
|
||||
protected InGame(BeatmapInfo beatmapInfo, RulesetInfo ruleset)
|
||||
protected InGame(IBeatmapInfo beatmapInfo, RulesetInfo ruleset)
|
||||
{
|
||||
BeatmapInfo = beatmapInfo;
|
||||
Ruleset = ruleset;
|
||||
@ -42,7 +42,7 @@ namespace osu.Game.Users
|
||||
|
||||
public class InMultiplayerGame : InGame
|
||||
{
|
||||
public InMultiplayerGame(BeatmapInfo beatmapInfo, RulesetInfo ruleset)
|
||||
public InMultiplayerGame(IBeatmapInfo beatmapInfo, RulesetInfo ruleset)
|
||||
: base(beatmapInfo, ruleset)
|
||||
{
|
||||
}
|
||||
@ -52,7 +52,7 @@ namespace osu.Game.Users
|
||||
|
||||
public class InPlaylistGame : InGame
|
||||
{
|
||||
public InPlaylistGame(BeatmapInfo beatmapInfo, RulesetInfo ruleset)
|
||||
public InPlaylistGame(IBeatmapInfo beatmapInfo, RulesetInfo ruleset)
|
||||
: base(beatmapInfo, ruleset)
|
||||
{
|
||||
}
|
||||
@ -60,7 +60,7 @@ namespace osu.Game.Users
|
||||
|
||||
public class InSoloGame : InGame
|
||||
{
|
||||
public InSoloGame(BeatmapInfo beatmapInfo, RulesetInfo ruleset)
|
||||
public InSoloGame(IBeatmapInfo beatmapInfo, RulesetInfo ruleset)
|
||||
: base(beatmapInfo, ruleset)
|
||||
{
|
||||
}
|
||||
@ -68,9 +68,9 @@ namespace osu.Game.Users
|
||||
|
||||
public class Editing : UserActivity
|
||||
{
|
||||
public BeatmapInfo BeatmapInfo { get; }
|
||||
public IBeatmapInfo BeatmapInfo { get; }
|
||||
|
||||
public Editing(BeatmapInfo info)
|
||||
public Editing(IBeatmapInfo info)
|
||||
{
|
||||
BeatmapInfo = info;
|
||||
}
|
||||
|
Reference in New Issue
Block a user