1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 04:52:57 +08:00

Rename GameBeatmap -> BindableBeatmap

This commit is contained in:
smoogipoo 2018-06-06 20:16:20 +09:00
parent 4086ff7313
commit 72cc53aded
23 changed files with 55 additions and 55 deletions

View File

@ -96,7 +96,7 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
}
[BackgroundDependencyLoader]
private void load(OsuConfigManager config, IGameBeatmap beatmap)
private void load(OsuConfigManager config, IBindableBeatmap beatmap)
{
Child = cursorContainer = new SkinnableDrawable("cursor", _ => new CircularContainer
{

View File

@ -12,14 +12,14 @@ namespace osu.Game.Beatmaps
{
/// <summary>
/// A <see cref="Bindable{WorkingBeatmap}"/> for the <see cref="OsuGame"/> beatmap.
/// This should be used sparingly in-favour of <see cref="IGameBeatmap"/>.
/// This should be used sparingly in-favour of <see cref="IBindableBeatmap"/>.
/// </summary>
public abstract class GameBeatmap : NonNullableBindable<WorkingBeatmap>, IGameBeatmap
public abstract class BindableBeatmap : NonNullableBindable<WorkingBeatmap>, IBindableBeatmap
{
private AudioManager audioManager;
private WorkingBeatmap lastBeatmap;
protected GameBeatmap(WorkingBeatmap defaultValue)
protected BindableBeatmap(WorkingBeatmap defaultValue)
: base(defaultValue)
{
}
@ -63,13 +63,13 @@ namespace osu.Game.Beatmaps
}
[NotNull]
IGameBeatmap IGameBeatmap.GetBoundCopy() => GetBoundCopy();
IBindableBeatmap IBindableBeatmap.GetBoundCopy() => GetBoundCopy();
/// <summary>
/// Retrieve a new <see cref="GameBeatmap"/> instance weakly bound to this <see cref="GameBeatmap"/>.
/// If you are further binding to events of the retrieved <see cref="GameBeatmap"/>, ensure a local reference is held.
/// Retrieve a new <see cref="BindableBeatmap"/> instance weakly bound to this <see cref="BindableBeatmap"/>.
/// If you are further binding to events of the retrieved <see cref="BindableBeatmap"/>, ensure a local reference is held.
/// </summary>
[NotNull]
public abstract GameBeatmap GetBoundCopy();
public abstract BindableBeatmap GetBoundCopy();
}
}

View File

@ -8,12 +8,12 @@ namespace osu.Game.Beatmaps
/// <summary>
/// Read-only interface for the <see cref="OsuGame"/> beatmap.
/// </summary>
public interface IGameBeatmap : IBindable<WorkingBeatmap>
public interface IBindableBeatmap : IBindable<WorkingBeatmap>
{
/// <summary>
/// Retrieve a new <see cref="IGameBeatmap"/> instance weakly bound to this <see cref="IGameBeatmap"/>.
/// If you are further binding to events of the retrieved <see cref="IGameBeatmap"/>, ensure a local reference is held.
/// Retrieve a new <see cref="IBindableBeatmap"/> instance weakly bound to this <see cref="IBindableBeatmap"/>.
/// If you are further binding to events of the retrieved <see cref="IBindableBeatmap"/>, ensure a local reference is held.
/// </summary>
IGameBeatmap GetBoundCopy();
IBindableBeatmap GetBoundCopy();
}
}

View File

@ -74,7 +74,7 @@ namespace osu.Game.Graphics.Containers
}
[BackgroundDependencyLoader]
private void load(IGameBeatmap beatmap)
private void load(IBindableBeatmap beatmap)
{
Beatmap.BindTo(beatmap);
}

View File

@ -64,8 +64,8 @@ namespace osu.Game
protected override Container<Drawable> Content => content;
private OsuGameBeatmap beatmap;
protected GameBeatmap Beatmap => beatmap;
private OsuBindableBeatmap beatmap;
protected BindableBeatmap Beatmap => beatmap;
private Bindable<bool> fpsDisplayVisible;
@ -157,15 +157,15 @@ namespace osu.Game
Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Venera-Light"));
var defaultBeatmap = new DummyWorkingBeatmap(this);
beatmap = new OsuGameBeatmap(defaultBeatmap, Audio);
beatmap = new OsuBindableBeatmap(defaultBeatmap, Audio);
BeatmapManager.DefaultBeatmap = defaultBeatmap;
// tracks play so loud our samples can't keep up.
// this adds a global reduction of track volume for the time being.
Audio.Track.AddAdjustment(AdjustableProperty.Volume, new BindableDouble(0.8));
dependencies.CacheAs<GameBeatmap>(beatmap);
dependencies.CacheAs<IGameBeatmap>(beatmap);
dependencies.CacheAs<BindableBeatmap>(beatmap);
dependencies.CacheAs<IBindableBeatmap>(beatmap);
FileStore.Cleanup();
@ -237,22 +237,22 @@ namespace osu.Game
public string[] HandledExtensions => fileImporters.SelectMany(i => i.HandledExtensions).ToArray();
private class OsuGameBeatmap : GameBeatmap
private class OsuBindableBeatmap : BindableBeatmap
{
public OsuGameBeatmap(WorkingBeatmap defaultValue, AudioManager audioManager)
public OsuBindableBeatmap(WorkingBeatmap defaultValue, AudioManager audioManager)
: this(defaultValue)
{
RegisterAudioManager(audioManager);
}
private OsuGameBeatmap(WorkingBeatmap defaultValue)
private OsuBindableBeatmap(WorkingBeatmap defaultValue)
: base(defaultValue)
{
}
public override GameBeatmap GetBoundCopy()
public override BindableBeatmap GetBoundCopy()
{
var copy = new OsuGameBeatmap(Default);
var copy = new OsuBindableBeatmap(Default);
copy.BindTo(this);
return copy;
}

View File

@ -73,7 +73,7 @@ namespace osu.Game.Overlays.Music
}
[BackgroundDependencyLoader]
private void load(BeatmapManager beatmaps, IGameBeatmap beatmap)
private void load(BeatmapManager beatmaps, IBindableBeatmap beatmap)
{
beatmaps.GetAllUsableBeatmapSets().ForEach(addBeatmapSet);
beatmaps.ItemAdded += addBeatmapSet;

View File

@ -26,14 +26,14 @@ namespace osu.Game.Overlays.Music
/// </summary>
public Action<BeatmapSetInfo, int> OrderChanged;
private GameBeatmap beatmap;
private BindableBeatmap beatmap;
private BeatmapManager beatmaps;
private FilterControl filter;
private PlaylistList list;
[BackgroundDependencyLoader]
private void load(OsuColour colours, GameBeatmap beatmap, BeatmapManager beatmaps)
private void load(OsuColour colours, BindableBeatmap beatmap, BeatmapManager beatmaps)
{
this.beatmap = beatmap.GetBoundCopy();
this.beatmaps = beatmaps;

View File

@ -54,7 +54,7 @@ namespace osu.Game.Overlays
private Container dragContainer;
private Container playerContainer;
private GameBeatmap beatmap;
private BindableBeatmap beatmap;
public MusicController()
{
@ -94,7 +94,7 @@ namespace osu.Game.Overlays
}
[BackgroundDependencyLoader]
private void load(GameBeatmap beatmap, BeatmapManager beatmaps, OsuColour colours, LocalisationEngine localisation)
private void load(BindableBeatmap beatmap, BeatmapManager beatmaps, OsuColour colours, LocalisationEngine localisation)
{
this.beatmap = beatmap.GetBoundCopy();
this.beatmaps = beatmaps;

View File

@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Edit
}
[BackgroundDependencyLoader]
private void load(IGameBeatmap beatmap, IFrameBasedClock framedClock)
private void load(IBindableBeatmap beatmap, IFrameBasedClock framedClock)
{
this.beatmap.BindTo(beatmap);

View File

@ -42,7 +42,7 @@ namespace osu.Game.Screens.Edit.Components
}
[BackgroundDependencyLoader]
private void load(IGameBeatmap beatmap, OsuColour colours)
private void load(IBindableBeatmap beatmap, OsuColour colours)
{
Beatmap.BindTo(beatmap);
background.Colour = colours.Gray1;

View File

@ -32,7 +32,7 @@ namespace osu.Game.Screens.Edit.Components.Timelines.Summary.Parts
}
[BackgroundDependencyLoader]
private void load(IGameBeatmap beatmap)
private void load(IBindableBeatmap beatmap)
{
Beatmap.BindTo(beatmap);
}

View File

@ -44,7 +44,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Timeline
}
[BackgroundDependencyLoader]
private void load(IGameBeatmap beatmap)
private void load(IBindableBeatmap beatmap)
{
this.beatmap.BindTo(beatmap);

View File

@ -29,7 +29,7 @@ namespace osu.Game.Screens.Edit.Screens
}
[BackgroundDependencyLoader]
private void load(IGameBeatmap beatmap)
private void load(IBindableBeatmap beatmap)
{
Beatmap.BindTo(beatmap);
}

View File

@ -27,7 +27,7 @@ namespace osu.Game.Screens.Menu
/// </summary>
public bool DidLoadMenu;
private GameBeatmap beatmapBacking;
private BindableBeatmap beatmapBacking;
private MainMenu mainMenu;
private SampleChannel welcome;
@ -46,7 +46,7 @@ namespace osu.Game.Screens.Menu
private WorkingBeatmap beatmap;
[BackgroundDependencyLoader]
private void load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game, GameBeatmap beatmap)
private void load(AudioManager audio, OsuConfigManager config, BeatmapManager beatmaps, Framework.Game game, BindableBeatmap beatmap)
{
beatmapBacking = beatmap.GetBoundCopy();

View File

@ -78,7 +78,7 @@ namespace osu.Game.Screens.Menu
}
[BackgroundDependencyLoader]
private void load(ShaderManager shaders, IGameBeatmap beatmap)
private void load(ShaderManager shaders, IBindableBeatmap beatmap)
{
this.beatmap.BindTo(beatmap);
shader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE_ROUNDED);

View File

@ -45,7 +45,7 @@ namespace osu.Game.Screens.Menu
}
[BackgroundDependencyLoader]
private void load(IGameBeatmap beatmap, OsuColour colours)
private void load(IBindableBeatmap beatmap, OsuColour colours)
{
this.beatmap.BindTo(beatmap);

View File

@ -79,7 +79,7 @@ namespace osu.Game.Screens
private SampleChannel sampleExit;
[BackgroundDependencyLoader(permitNulls: true)]
private void load(IGameBeatmap beatmap, OsuGame osuGame, AudioManager audio)
private void load(IBindableBeatmap beatmap, OsuGame osuGame, AudioManager audio)
{
if (beatmap != null)
Beatmap.BindTo(beatmap);

View File

@ -30,7 +30,7 @@ namespace osu.Game.Screens.Select
protected readonly BeatmapDetailArea BeatmapDetails;
private bool removeAutoModOnResume;
private GameBeatmap beatmap;
private BindableBeatmap beatmap;
public PlaySongSelect()
{
@ -55,7 +55,7 @@ namespace osu.Game.Screens.Select
public readonly Bindable<IEnumerable<Mod>> SelectedMods = new Bindable<IEnumerable<Mod>>(new List<Mod>());
[BackgroundDependencyLoader(true)]
private void load(OsuColour colours, AudioManager audio, BeatmapManager beatmaps, DialogOverlay dialogOverlay, OsuGame osu, GameBeatmap beatmap)
private void load(OsuColour colours, AudioManager audio, BeatmapManager beatmaps, DialogOverlay dialogOverlay, OsuGame osu, BindableBeatmap beatmap)
{
this.beatmap = beatmap.GetBoundCopy();

View File

@ -62,7 +62,7 @@ namespace osu.Game.Screens.Select
private SampleChannel sampleChangeDifficulty;
private SampleChannel sampleChangeBeatmap;
private GameBeatmap beatmap;
private BindableBeatmap beatmap;
private DependencyContainer dependencies;
protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent)
@ -179,7 +179,7 @@ namespace osu.Game.Screens.Select
}
[BackgroundDependencyLoader(permitNulls: true)]
private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuGame osu, OsuColour colours, GameBeatmap beatmap)
private void load(BeatmapManager beatmaps, AudioManager audio, DialogOverlay dialog, OsuGame osu, OsuColour colours, BindableBeatmap beatmap)
{
this.beatmap = beatmap.GetBoundCopy();

View File

@ -64,7 +64,7 @@ namespace osu.Game.Storyboards.Drawables
}
[BackgroundDependencyLoader]
private void load(IGameBeatmap beatmap, TextureStore textureStore)
private void load(IBindableBeatmap beatmap, TextureStore textureStore)
{
var basePath = Animation.Path.ToLowerInvariant();
for (var frame = 0; frame < Animation.FrameCount; frame++)

View File

@ -63,7 +63,7 @@ namespace osu.Game.Storyboards.Drawables
}
[BackgroundDependencyLoader]
private void load(IGameBeatmap beatmap, TextureStore textureStore)
private void load(IBindableBeatmap beatmap, TextureStore textureStore)
{
var spritePath = Sprite.Path.ToLowerInvariant();
var path = beatmap.Value.BeatmapSetInfo.Files.FirstOrDefault(f => f.Filename.ToLowerInvariant() == spritePath)?.FileInfo.StoragePath;

View File

@ -13,7 +13,7 @@ namespace osu.Game.Tests.Visual
public abstract class OsuTestCase : TestCase
{
private readonly OsuTestBeatmap beatmap = new OsuTestBeatmap(new DummyWorkingBeatmap());
protected GameBeatmap Beatmap => beatmap;
protected BindableBeatmap Beatmap => beatmap;
private DependencyContainer dependencies;
@ -21,8 +21,8 @@ namespace osu.Game.Tests.Visual
{
dependencies = new DependencyContainer(base.CreateLocalDependencies(parent));
dependencies.CacheAs<GameBeatmap>(beatmap);
dependencies.CacheAs<IGameBeatmap>(beatmap);
dependencies.CacheAs<BindableBeatmap>(beatmap);
dependencies.CacheAs<IBindableBeatmap>(beatmap);
return dependencies;
}
@ -63,7 +63,7 @@ namespace osu.Game.Tests.Visual
public void RunTestBlocking(TestCase test) => runner.RunTestBlocking(test);
}
private class OsuTestBeatmap : GameBeatmap
private class OsuTestBeatmap : BindableBeatmap
{
public OsuTestBeatmap(WorkingBeatmap defaultValue)
: base(defaultValue)
@ -72,7 +72,7 @@ namespace osu.Game.Tests.Visual
public void SetAudioManager(AudioManager audioManager) => RegisterAudioManager(audioManager);
public override GameBeatmap GetBoundCopy()
public override BindableBeatmap GetBoundCopy()
{
var copy = new OsuTestBeatmap(Default);
copy.BindTo(this);

View File

@ -108,9 +108,9 @@ namespace osu.Game.Tests.Visual
{
private readonly Container<BeatmapDisplay> beatmapDisplays;
private readonly Ruleset ruleset;
private readonly GameBeatmap beatmapBindable;
private readonly BindableBeatmap beatmapBindable;
public BeatmapList(Ruleset ruleset, GameBeatmap beatmapBindable)
public BeatmapList(Ruleset ruleset, BindableBeatmap beatmapBindable)
{
this.ruleset = ruleset;
this.beatmapBindable = beatmapBindable;
@ -140,7 +140,7 @@ namespace osu.Game.Tests.Visual
private readonly OsuSpriteText text;
private readonly BeatmapInfo beatmap;
private readonly GameBeatmap beatmapBindable;
private readonly BindableBeatmap beatmapBindable;
private BeatmapManager beatmaps;
@ -148,7 +148,7 @@ namespace osu.Game.Tests.Visual
public string TooltipText => text.Text;
public BeatmapDisplay(BeatmapInfo beatmap, GameBeatmap beatmapBindable)
public BeatmapDisplay(BeatmapInfo beatmap, BindableBeatmap beatmapBindable)
{
this.beatmap = beatmap;
this.beatmapBindable = beatmapBindable;
@ -223,7 +223,7 @@ namespace osu.Game.Tests.Visual
}
[BackgroundDependencyLoader]
private void load(IGameBeatmap beatmap, APIAccess api)
private void load(IBindableBeatmap beatmap, APIAccess api)
{
this.api = api;
@ -336,7 +336,7 @@ namespace osu.Game.Tests.Visual
}
[BackgroundDependencyLoader]
private void load(IGameBeatmap beatmap)
private void load(IBindableBeatmap beatmap)
{
beatmap.ValueChanged += beatmapChanged;
}