// Copyright (c) ppy Pty Ltd . 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; using osu.Game.Scoring; using osu.Game.Scoring.Legacy; namespace PerformanceCalculator { /// /// A which has a predefined beatmap and rulesets. /// public class ProcessorScoreParser : LegacyScoreParser { private readonly WorkingBeatmap beatmap; public ProcessorScoreParser(WorkingBeatmap beatmap) { this.beatmap = beatmap; } public Score Parse(ScoreInfo scoreInfo) { var score = new Score { ScoreInfo = scoreInfo }; CalculateAccuracy(score.ScoreInfo); return score; } protected override Ruleset GetRuleset(int rulesetId) => LegacyHelper.GetRulesetFromLegacyID(rulesetId); protected override WorkingBeatmap GetBeatmap(string md5Hash) => beatmap; } }