From 60b38b27764bc1de1a6033c86124146b075b533d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 18 Sep 2017 12:48:45 +0900 Subject: [PATCH] Add the most basic score calculation for catch --- .../Scoring/CatchScoreProcessor.cs | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs index 11e95622ca..16756e65f1 100644 --- a/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs +++ b/osu.Game.Rulesets.Catch/Scoring/CatchScoreProcessor.cs @@ -1,7 +1,10 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Catch.Judgements; using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Objects.Drawables; using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; @@ -9,13 +12,22 @@ namespace osu.Game.Rulesets.Catch.Scoring { internal class CatchScoreProcessor : ScoreProcessor { - public CatchScoreProcessor() - { - } - public CatchScoreProcessor(RulesetContainer rulesetContainer) : base(rulesetContainer) { } + + protected override void SimulateAutoplay(Beatmap beatmap) + { + foreach (var obj in beatmap.HitObjects) + { + var fruit = obj as Fruit; + + if (fruit != null) + AddJudgement(new CatchJudgement { Result = HitResult.Perfect }); + } + + base.SimulateAutoplay(beatmap); + } } }