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