-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Access beatmap store via abstract base class
The intention here is to make things more testable going forward. Specifically, to remove the "back-door" entrance into `BeatmapCarousel` where `BeatmapSets` can be set by tests and bypas/block realm retrieval.
- Loading branch information
Showing
10 changed files
with
59 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System.Threading; | ||
using osu.Framework.Bindables; | ||
using osu.Framework.Graphics; | ||
using osu.Game.Beatmaps; | ||
|
||
namespace osu.Game.Database | ||
{ | ||
/// <summary> | ||
/// A store which contains a thread-safe representation of beatmaps available game-wide. | ||
/// This exposes changes to available beatmaps, such as post-import or deletion. | ||
/// </summary> | ||
/// <remarks> | ||
/// The main goal of classes which implement this interface should be to provide change | ||
/// tracking and thread safety in a performant way, rather than having to worry about such | ||
/// concerns at the point of usage. | ||
/// </remarks> | ||
public abstract partial class BeatmapStore : Component | ||
{ | ||
/// <summary> | ||
/// Get all available beatmaps. | ||
/// </summary> | ||
/// <param name="cancellationToken">A cancellation token which allows early abort from the operation.</param> | ||
/// <returns>A bindable list of all available beatmap sets.</returns> | ||
/// <remarks> | ||
/// This operation may block during the initial load process. | ||
/// | ||
/// It is generally expected that once a beatmap store is in a good state, the overhead of this call | ||
/// should be negligible. | ||
/// </remarks> | ||
public abstract IBindableList<BeatmapSetInfo> GetBeatmaps(CancellationToken? cancellationToken); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters