mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Rename decoder
This commit is contained in:
27
osu.Game/Scoring/Legacy/DatabasedLegacyScoreDecoder.cs
Normal file
27
osu.Game/Scoring/Legacy/DatabasedLegacyScoreDecoder.cs
Normal file
@ -0,0 +1,27 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Rulesets;
|
||||
|
||||
namespace osu.Game.Scoring.Legacy
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="LegacyScoreDecoder"/> which retrieves the applicable <see cref="Beatmap"/> and <see cref="Ruleset"/>
|
||||
/// for the score from the database.
|
||||
/// </summary>
|
||||
public class DatabasedLegacyScoreDecoder : LegacyScoreDecoder
|
||||
{
|
||||
private readonly RulesetStore rulesets;
|
||||
private readonly BeatmapManager beatmaps;
|
||||
|
||||
public DatabasedLegacyScoreDecoder(RulesetStore rulesets, BeatmapManager beatmaps)
|
||||
{
|
||||
this.rulesets = rulesets;
|
||||
this.beatmaps = beatmaps;
|
||||
}
|
||||
|
||||
protected override Ruleset GetRuleset(int rulesetId) => rulesets.GetRuleset(rulesetId).CreateInstance();
|
||||
protected override WorkingBeatmap GetBeatmap(string md5Hash) => beatmaps.GetWorkingBeatmap(beatmaps.QueryBeatmap(b => !b.BeatmapSet.DeletePending && b.MD5Hash == md5Hash));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user