mirror of
https://github.com/osukey/osukey.git
synced 2025-08-05 07:33:55 +09:00
Rename BeatmapDifficultyManager to BeatmapDifficultyCache
This commit is contained in:
@ -37,13 +37,13 @@ namespace osu.Game.Scoring
|
||||
private readonly Func<BeatmapManager> beatmaps;
|
||||
|
||||
[CanBeNull]
|
||||
private readonly Func<BeatmapDifficultyManager> difficulties;
|
||||
private readonly Func<BeatmapDifficultyCache> difficulties;
|
||||
|
||||
[CanBeNull]
|
||||
private readonly OsuConfigManager configManager;
|
||||
|
||||
public ScoreManager(RulesetStore rulesets, Func<BeatmapManager> beatmaps, Storage storage, IAPIProvider api, IDatabaseContextFactory contextFactory, IIpcHost importHost = null,
|
||||
Func<BeatmapDifficultyManager> difficulties = null, OsuConfigManager configManager = null)
|
||||
Func<BeatmapDifficultyCache> difficulties = null, OsuConfigManager configManager = null)
|
||||
: base(storage, contextFactory, api, new ScoreStore(contextFactory, storage), importHost)
|
||||
{
|
||||
this.rulesets = rulesets;
|
||||
@ -121,14 +121,14 @@ namespace osu.Game.Scoring
|
||||
public readonly Bindable<ScoringMode> ScoringMode = new Bindable<ScoringMode>();
|
||||
|
||||
private readonly ScoreInfo score;
|
||||
private readonly Func<BeatmapDifficultyManager> difficulties;
|
||||
private readonly Func<BeatmapDifficultyCache> difficulties;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="TotalScoreBindable"/>.
|
||||
/// </summary>
|
||||
/// <param name="score">The <see cref="ScoreInfo"/> to provide the total score of.</param>
|
||||
/// <param name="difficulties">A function to retrieve the <see cref="BeatmapDifficultyManager"/>.</param>
|
||||
public TotalScoreBindable(ScoreInfo score, Func<BeatmapDifficultyManager> difficulties)
|
||||
/// <param name="difficulties">A function to retrieve the <see cref="BeatmapDifficultyCache"/>.</param>
|
||||
public TotalScoreBindable(ScoreInfo score, Func<BeatmapDifficultyCache> difficulties)
|
||||
{
|
||||
this.score = score;
|
||||
this.difficulties = difficulties;
|
||||
|
@ -22,7 +22,7 @@ namespace osu.Game.Scoring
|
||||
private readonly ConcurrentDictionary<PerformanceCacheLookup, double> performanceCache = new ConcurrentDictionary<PerformanceCacheLookup, double>();
|
||||
|
||||
[Resolved]
|
||||
private BeatmapDifficultyManager difficultyManager { get; set; }
|
||||
private BeatmapDifficultyCache difficultyCache { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Calculates performance for the given <see cref="ScoreInfo"/>.
|
||||
@ -41,7 +41,7 @@ namespace osu.Game.Scoring
|
||||
|
||||
private async Task<double?> computePerformanceAsync(ScoreInfo score, PerformanceCacheLookup lookupKey, CancellationToken token = default)
|
||||
{
|
||||
var attributes = await difficultyManager.GetDifficultyAsync(score.Beatmap, score.Ruleset, score.Mods, token);
|
||||
var attributes = await difficultyCache.GetDifficultyAsync(score.Beatmap, score.Ruleset, score.Mods, token);
|
||||
|
||||
// Performance calculation requires the beatmap and ruleset to be locally available. If not, return a default value.
|
||||
if (attributes.Attributes == null)
|
||||
|
Reference in New Issue
Block a user