2018-01-05 11:21:19 +00:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-02-07 04:59:30 +00:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-09-02 11:30:27 +00:00
|
|
|
|
|
2017-08-09 02:50:34 +00:00
|
|
|
|
using osu.Framework.Input;
|
2017-03-10 06:08:53 +00:00
|
|
|
|
using osu.Game.Beatmaps;
|
2018-02-28 07:34:47 +00:00
|
|
|
|
using osu.Game.Input.Handlers;
|
2017-04-18 07:05:58 +00:00
|
|
|
|
using osu.Game.Rulesets.Catch.Beatmaps;
|
|
|
|
|
using osu.Game.Rulesets.Catch.Objects;
|
2017-08-02 10:37:20 +00:00
|
|
|
|
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
2018-01-12 09:35:28 +00:00
|
|
|
|
using osu.Game.Rulesets.Catch.Replays;
|
2017-04-18 07:05:58 +00:00
|
|
|
|
using osu.Game.Rulesets.Catch.Scoring;
|
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2018-01-12 09:35:28 +00:00
|
|
|
|
using osu.Game.Rulesets.Replays;
|
2017-04-18 07:05:58 +00:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
using osu.Game.Rulesets.UI;
|
2018-01-04 10:22:15 +00:00
|
|
|
|
using osu.Game.Rulesets.UI.Scrolling;
|
2018-01-12 12:46:50 +00:00
|
|
|
|
using OpenTK;
|
2016-09-02 11:30:27 +00:00
|
|
|
|
|
2017-04-18 07:05:58 +00:00
|
|
|
|
namespace osu.Game.Rulesets.Catch.UI
|
2016-09-02 11:30:27 +00:00
|
|
|
|
{
|
2017-11-28 09:37:41 +00:00
|
|
|
|
public class CatchRulesetContainer : ScrollingRulesetContainer<CatchPlayfield, CatchHitObject>
|
2016-09-02 11:30:27 +00:00
|
|
|
|
{
|
2017-08-09 04:28:29 +00:00
|
|
|
|
public CatchRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
2017-08-09 04:04:11 +00:00
|
|
|
|
: base(ruleset, beatmap, isForCurrentRuleset)
|
2017-03-10 06:08:53 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-16 03:40:35 +00:00
|
|
|
|
public override ScoreProcessor CreateScoreProcessor() => new CatchScoreProcessor(this);
|
|
|
|
|
|
2018-02-28 07:34:47 +00:00
|
|
|
|
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new CatchFramedReplayInputHandler(replay);
|
2018-01-12 09:35:28 +00:00
|
|
|
|
|
2017-11-28 09:37:41 +00:00
|
|
|
|
protected override BeatmapProcessor<CatchHitObject> CreateBeatmapProcessor() => new CatchBeatmapProcessor();
|
2017-09-15 11:54:34 +00:00
|
|
|
|
|
2017-11-28 09:37:41 +00:00
|
|
|
|
protected override BeatmapConverter<CatchHitObject> CreateBeatmapConverter() => new CatchBeatmapConverter();
|
2017-03-11 17:26:10 +00:00
|
|
|
|
|
2018-01-12 12:46:50 +00:00
|
|
|
|
protected override Playfield CreatePlayfield() => new CatchPlayfield(Beatmap.BeatmapInfo.BaseDifficulty, GetVisualRepresentation);
|
2016-09-02 11:30:27 +00:00
|
|
|
|
|
2017-08-21 03:31:21 +00:00
|
|
|
|
public override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo);
|
2017-08-09 02:50:34 +00:00
|
|
|
|
|
2017-11-28 09:37:41 +00:00
|
|
|
|
protected override DrawableHitObject<CatchHitObject> GetVisualRepresentation(CatchHitObject h)
|
2017-08-02 10:37:20 +00:00
|
|
|
|
{
|
2018-01-10 05:52:22 +00:00
|
|
|
|
switch (h)
|
|
|
|
|
{
|
|
|
|
|
case Fruit fruit:
|
|
|
|
|
return new DrawableFruit(fruit);
|
|
|
|
|
case JuiceStream stream:
|
2018-01-12 12:46:50 +00:00
|
|
|
|
return new DrawableJuiceStream(stream, GetVisualRepresentation);
|
2018-01-10 05:52:22 +00:00
|
|
|
|
case BananaShower banana:
|
2018-01-12 12:46:50 +00:00
|
|
|
|
return new DrawableBananaShower(banana, GetVisualRepresentation);
|
|
|
|
|
case TinyDroplet tiny:
|
|
|
|
|
return new DrawableDroplet(tiny) { Scale = new Vector2(0.5f) };
|
|
|
|
|
case Droplet droplet:
|
|
|
|
|
return new DrawableDroplet(droplet);
|
2018-01-10 05:52:22 +00:00
|
|
|
|
}
|
2017-08-02 10:37:20 +00:00
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2016-09-02 11:30:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|