mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 22:56:36 +09:00
Remove track store reference counting, use single instance stores
This commit is contained in:
@ -19,21 +19,16 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
protected class BeatmapManagerWorkingBeatmap : WorkingBeatmap
|
||||
{
|
||||
public readonly TextureStore TextureStore;
|
||||
public readonly ITrackStore TrackStore;
|
||||
|
||||
private readonly IResourceStore<byte[]> store;
|
||||
private readonly Action<ITrackStore> dereferenceAction;
|
||||
private readonly TextureStore textureStore;
|
||||
private readonly ITrackStore trackStore;
|
||||
|
||||
public BeatmapManagerWorkingBeatmap(IResourceStore<byte[]> store, TextureStore textureStore, ITrackStore trackStore, BeatmapInfo beatmapInfo, AudioManager audioManager,
|
||||
Action<ITrackStore> dereferenceAction)
|
||||
public BeatmapManagerWorkingBeatmap(IResourceStore<byte[]> store, TextureStore textureStore, ITrackStore trackStore, BeatmapInfo beatmapInfo, AudioManager audioManager)
|
||||
: base(beatmapInfo, audioManager)
|
||||
{
|
||||
this.store = store;
|
||||
this.dereferenceAction = dereferenceAction;
|
||||
|
||||
TextureStore = textureStore;
|
||||
TrackStore = trackStore;
|
||||
this.textureStore = textureStore;
|
||||
this.trackStore = trackStore;
|
||||
}
|
||||
|
||||
protected override IBeatmap GetBeatmap()
|
||||
@ -61,7 +56,7 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
try
|
||||
{
|
||||
return TextureStore.Get(getPathForFile(Metadata.BackgroundFile));
|
||||
return textureStore.Get(getPathForFile(Metadata.BackgroundFile));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -74,7 +69,7 @@ namespace osu.Game.Beatmaps
|
||||
{
|
||||
try
|
||||
{
|
||||
return TrackStore.Get(getPathForFile(Metadata.AudioFile));
|
||||
return trackStore.Get(getPathForFile(Metadata.AudioFile));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -140,11 +135,6 @@ namespace osu.Game.Beatmaps
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
~BeatmapManagerWorkingBeatmap()
|
||||
{
|
||||
dereferenceAction?.Invoke(TrackStore);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user