mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 05:32:54 +08:00
Nest classes + make private
This commit is contained in:
parent
600b823a30
commit
62c2dbc310
@ -87,87 +87,87 @@ namespace osu.Game.Rulesets.UI
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A sample store which adds a fallback source and prevents disposal of the fallback source.
|
||||
/// </summary>
|
||||
public class FallbackSampleStore : ISampleStore
|
||||
{
|
||||
private readonly ISampleStore primary;
|
||||
private readonly ISampleStore fallback;
|
||||
|
||||
public FallbackSampleStore(ISampleStore primary, ISampleStore fallback)
|
||||
/// <summary>
|
||||
/// A sample store which adds a fallback source and prevents disposal of the fallback source.
|
||||
/// </summary>
|
||||
private class FallbackSampleStore : ISampleStore
|
||||
{
|
||||
this.primary = primary;
|
||||
this.fallback = fallback;
|
||||
private readonly ISampleStore primary;
|
||||
private readonly ISampleStore fallback;
|
||||
|
||||
public FallbackSampleStore(ISampleStore primary, ISampleStore fallback)
|
||||
{
|
||||
this.primary = primary;
|
||||
this.fallback = fallback;
|
||||
}
|
||||
|
||||
public SampleChannel Get(string name) => primary.Get(name) ?? fallback.Get(name);
|
||||
|
||||
public Task<SampleChannel> GetAsync(string name) => primary.GetAsync(name) ?? fallback.GetAsync(name);
|
||||
|
||||
public Stream GetStream(string name) => primary.GetStream(name) ?? fallback.GetStream(name);
|
||||
|
||||
public IEnumerable<string> GetAvailableResources() => throw new NotSupportedException();
|
||||
|
||||
public void AddAdjustment(AdjustableProperty type, BindableNumber<double> adjustBindable) => throw new NotSupportedException();
|
||||
|
||||
public void RemoveAdjustment(AdjustableProperty type, BindableNumber<double> adjustBindable) => throw new NotSupportedException();
|
||||
|
||||
public void RemoveAllAdjustments(AdjustableProperty type) => throw new NotSupportedException();
|
||||
|
||||
public BindableNumber<double> Volume => throw new NotSupportedException();
|
||||
|
||||
public BindableNumber<double> Balance => throw new NotSupportedException();
|
||||
|
||||
public BindableNumber<double> Frequency => throw new NotSupportedException();
|
||||
|
||||
public BindableNumber<double> Tempo => throw new NotSupportedException();
|
||||
|
||||
public IBindable<double> GetAggregate(AdjustableProperty type) => throw new NotSupportedException();
|
||||
|
||||
public IBindable<double> AggregateVolume => throw new NotSupportedException();
|
||||
|
||||
public IBindable<double> AggregateBalance => throw new NotSupportedException();
|
||||
|
||||
public IBindable<double> AggregateFrequency => throw new NotSupportedException();
|
||||
|
||||
public IBindable<double> AggregateTempo => throw new NotSupportedException();
|
||||
|
||||
public int PlaybackConcurrency
|
||||
{
|
||||
get => throw new NotSupportedException();
|
||||
set => throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
primary?.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public SampleChannel Get(string name) => primary.Get(name) ?? fallback.Get(name);
|
||||
|
||||
public Task<SampleChannel> GetAsync(string name) => primary.GetAsync(name) ?? fallback.GetAsync(name);
|
||||
|
||||
public Stream GetStream(string name) => primary.GetStream(name) ?? fallback.GetStream(name);
|
||||
|
||||
public IEnumerable<string> GetAvailableResources() => throw new NotSupportedException();
|
||||
|
||||
public void AddAdjustment(AdjustableProperty type, BindableNumber<double> adjustBindable) => throw new NotSupportedException();
|
||||
|
||||
public void RemoveAdjustment(AdjustableProperty type, BindableNumber<double> adjustBindable) => throw new NotSupportedException();
|
||||
|
||||
public void RemoveAllAdjustments(AdjustableProperty type) => throw new NotSupportedException();
|
||||
|
||||
public BindableNumber<double> Volume => throw new NotSupportedException();
|
||||
|
||||
public BindableNumber<double> Balance => throw new NotSupportedException();
|
||||
|
||||
public BindableNumber<double> Frequency => throw new NotSupportedException();
|
||||
|
||||
public BindableNumber<double> Tempo => throw new NotSupportedException();
|
||||
|
||||
public IBindable<double> GetAggregate(AdjustableProperty type) => throw new NotSupportedException();
|
||||
|
||||
public IBindable<double> AggregateVolume => throw new NotSupportedException();
|
||||
|
||||
public IBindable<double> AggregateBalance => throw new NotSupportedException();
|
||||
|
||||
public IBindable<double> AggregateFrequency => throw new NotSupportedException();
|
||||
|
||||
public IBindable<double> AggregateTempo => throw new NotSupportedException();
|
||||
|
||||
public int PlaybackConcurrency
|
||||
/// <summary>
|
||||
/// A texture store which adds a fallback source and prevents disposal of the fallback source.
|
||||
/// </summary>
|
||||
private class FallbackTextureStore : TextureStore
|
||||
{
|
||||
get => throw new NotSupportedException();
|
||||
set => throw new NotSupportedException();
|
||||
}
|
||||
private readonly TextureStore primary;
|
||||
private readonly TextureStore fallback;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
primary?.Dispose();
|
||||
}
|
||||
}
|
||||
public FallbackTextureStore(TextureStore primary, TextureStore fallback)
|
||||
{
|
||||
this.primary = primary;
|
||||
this.fallback = fallback;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A texture store which adds a fallback source and prevents disposal of the fallback source.
|
||||
/// </summary>
|
||||
public class FallbackTextureStore : TextureStore
|
||||
{
|
||||
private readonly TextureStore primary;
|
||||
private readonly TextureStore fallback;
|
||||
public override Texture Get(string name, WrapMode wrapModeS, WrapMode wrapModeT)
|
||||
=> primary.Get(name, wrapModeS, wrapModeT) ?? fallback.Get(name, wrapModeS, wrapModeT);
|
||||
|
||||
public FallbackTextureStore(TextureStore primary, TextureStore fallback)
|
||||
{
|
||||
this.primary = primary;
|
||||
this.fallback = fallback;
|
||||
}
|
||||
|
||||
public override Texture Get(string name, WrapMode wrapModeS, WrapMode wrapModeT)
|
||||
=> primary.Get(name, wrapModeS, wrapModeT) ?? fallback.Get(name, wrapModeS, wrapModeT);
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
primary?.Dispose();
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
primary?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user