2018-01-05 20:21:19 +09:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-02-07 13:59:30 +09:00
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
2016-09-02 19:25:13 +09:00
|
|
|
|
|
2018-01-12 18:13:17 +09:00
|
|
|
|
using osu.Framework.Graphics.Cursor;
|
2017-08-09 11:50:34 +09:00
|
|
|
|
using osu.Framework.Input;
|
2017-04-10 19:22:02 +09:00
|
|
|
|
using OpenTK;
|
2017-03-10 15:08:53 +09:00
|
|
|
|
using osu.Game.Beatmaps;
|
2018-02-28 16:34:47 +09:00
|
|
|
|
using osu.Game.Input.Handlers;
|
2017-04-18 16:05:58 +09:00
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Beatmaps;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
2017-08-24 15:36:42 +09:00
|
|
|
|
using osu.Game.Rulesets.Osu.Replays;
|
2017-04-18 16:05:58 +09:00
|
|
|
|
using osu.Game.Rulesets.Osu.Scoring;
|
2018-01-12 18:13:17 +09:00
|
|
|
|
using osu.Game.Rulesets.Osu.UI.Cursor;
|
2017-04-18 16:05:58 +09:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
using osu.Game.Rulesets.UI;
|
2017-08-24 15:36:42 +09:00
|
|
|
|
using osu.Game.Rulesets.Replays;
|
2016-09-02 19:25:13 +09:00
|
|
|
|
|
2017-04-18 16:05:58 +09:00
|
|
|
|
namespace osu.Game.Rulesets.Osu.UI
|
2016-09-02 19:25:13 +09:00
|
|
|
|
{
|
2017-09-06 18:05:51 +09:00
|
|
|
|
public class OsuRulesetContainer : RulesetContainer<OsuHitObject>
|
2016-09-02 19:25:13 +09:00
|
|
|
|
{
|
2017-08-09 13:28:29 +09:00
|
|
|
|
public OsuRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
2017-08-09 13:04:11 +09:00
|
|
|
|
: base(ruleset, beatmap, isForCurrentRuleset)
|
2017-03-10 15:08:53 +09:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-16 12:40:35 +09:00
|
|
|
|
public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor(this);
|
|
|
|
|
|
2017-04-18 09:38:52 +09:00
|
|
|
|
protected override BeatmapConverter<OsuHitObject> CreateBeatmapConverter() => new OsuBeatmapConverter();
|
2017-03-12 02:26:10 +09:00
|
|
|
|
|
2017-04-18 09:43:43 +09:00
|
|
|
|
protected override BeatmapProcessor<OsuHitObject> CreateBeatmapProcessor() => new OsuBeatmapProcessor();
|
2016-10-10 17:17:26 +09:00
|
|
|
|
|
2017-09-12 18:19:28 +09:00
|
|
|
|
protected override Playfield CreatePlayfield() => new OsuPlayfield();
|
2016-10-10 17:17:26 +09:00
|
|
|
|
|
2017-08-21 12:31:21 +09:00
|
|
|
|
public override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);
|
2017-03-14 16:00:35 +09:00
|
|
|
|
|
2017-09-06 18:05:51 +09:00
|
|
|
|
protected override DrawableHitObject<OsuHitObject> GetVisualRepresentation(OsuHitObject h)
|
2016-11-17 21:29:35 +09:00
|
|
|
|
{
|
2017-12-27 21:12:02 +01:00
|
|
|
|
if (h is HitCircle circle)
|
2017-03-07 10:59:19 +09:00
|
|
|
|
return new DrawableHitCircle(circle);
|
|
|
|
|
|
2017-12-27 21:12:02 +01:00
|
|
|
|
if (h is Slider slider)
|
2017-03-07 10:59:19 +09:00
|
|
|
|
return new DrawableSlider(slider);
|
|
|
|
|
|
2017-12-27 21:12:02 +01:00
|
|
|
|
if (h is Spinner spinner)
|
2017-03-07 10:59:19 +09:00
|
|
|
|
return new DrawableSpinner(spinner);
|
2016-11-17 21:29:35 +09:00
|
|
|
|
return null;
|
|
|
|
|
}
|
2017-04-10 19:22:02 +09:00
|
|
|
|
|
2018-02-28 16:34:47 +09:00
|
|
|
|
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new OsuReplayInputHandler(replay);
|
2017-08-24 15:36:42 +09:00
|
|
|
|
|
2018-02-19 17:04:18 +09:00
|
|
|
|
protected override Vector2 GetAspectAdjustedSize()
|
2018-02-19 17:02:27 +09:00
|
|
|
|
{
|
|
|
|
|
var aspectSize = DrawSize.X * 0.75f < DrawSize.Y ? new Vector2(DrawSize.X, DrawSize.X * 0.75f) : new Vector2(DrawSize.Y * 4f / 3f, DrawSize.Y);
|
2018-02-21 19:52:36 +09:00
|
|
|
|
return new Vector2(aspectSize.X / DrawSize.X, aspectSize.Y / DrawSize.Y);
|
2018-02-19 17:02:27 +09:00
|
|
|
|
}
|
2018-01-12 18:13:17 +09:00
|
|
|
|
|
|
|
|
|
protected override CursorContainer CreateCursor() => new GameplayCursor();
|
2016-09-02 19:25:13 +09:00
|
|
|
|
}
|
|
|
|
|
}
|