2018-01-05 20:21:19 +09:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-03-16 12:40:35 +09:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2017-12-22 21:42:54 +09:00
|
|
|
|
using System.Linq;
|
2017-09-18 12:48:45 +09:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Rulesets.Catch.Judgements;
|
2017-04-18 16:05:58 +09:00
|
|
|
|
using osu.Game.Rulesets.Catch.Objects;
|
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
using osu.Game.Rulesets.UI;
|
2017-03-16 12:40:35 +09:00
|
|
|
|
|
2017-04-18 16:05:58 +09:00
|
|
|
|
namespace osu.Game.Rulesets.Catch.Scoring
|
2017-03-16 12:40:35 +09:00
|
|
|
|
{
|
2018-01-10 15:37:55 +09:00
|
|
|
|
public class CatchScoreProcessor : ScoreProcessor<CatchHitObject>
|
2017-03-16 12:40:35 +09:00
|
|
|
|
{
|
2017-11-28 18:37:41 +09:00
|
|
|
|
public CatchScoreProcessor(RulesetContainer<CatchHitObject> rulesetContainer)
|
2017-09-18 12:48:45 +09:00
|
|
|
|
: base(rulesetContainer)
|
2017-03-16 13:13:45 +09:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2017-11-28 18:37:41 +09:00
|
|
|
|
protected override void SimulateAutoplay(Beatmap<CatchHitObject> beatmap)
|
2017-03-16 12:40:35 +09:00
|
|
|
|
{
|
2017-09-18 12:48:45 +09:00
|
|
|
|
foreach (var obj in beatmap.HitObjects)
|
|
|
|
|
{
|
2018-01-10 15:37:55 +09:00
|
|
|
|
switch (obj)
|
2017-10-10 20:22:57 +09:00
|
|
|
|
{
|
2018-01-10 15:37:55 +09:00
|
|
|
|
case JuiceStream stream:
|
|
|
|
|
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
|
|
|
|
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
2017-10-10 20:22:57 +09:00
|
|
|
|
|
2018-01-10 15:37:55 +09:00
|
|
|
|
foreach (var _ in stream.NestedHitObjects.Cast<CatchHitObject>())
|
|
|
|
|
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
|
|
|
|
break;
|
|
|
|
|
case BananaShower shower:
|
2017-10-10 20:22:57 +09:00
|
|
|
|
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
|
|
|
|
|
2018-01-10 15:37:55 +09:00
|
|
|
|
foreach (var _ in shower.NestedHitObjects.Cast<CatchHitObject>())
|
|
|
|
|
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
|
|
|
|
break;
|
|
|
|
|
case Fruit _:
|
|
|
|
|
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
|
|
|
|
break;
|
2017-10-10 20:22:57 +09:00
|
|
|
|
}
|
2017-09-18 12:48:45 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
base.SimulateAutoplay(beatmap);
|
2017-03-16 12:40:35 +09:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|