// Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using osu.Game.Beatmaps; using osu.Game.Rulesets; namespace osu.Game.Scoring.Legacy { /// /// A which retrieves the applicable and /// for the score from the database. /// public class DatabasedLegacyScoreParser : LegacyScoreParser { private readonly RulesetStore rulesets; private readonly BeatmapManager beatmaps; public DatabasedLegacyScoreParser(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.MD5Hash == md5Hash)); } }