2018-04-13 09:19:50 +00:00
|
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
2018-07-17 05:29:22 +00:00
|
|
|
|
using System.Linq;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Framework.Graphics.Cursor;
|
|
|
|
|
using osu.Framework.Input;
|
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Input.Handlers;
|
2018-11-28 08:20:37 +00:00
|
|
|
|
using osu.Game.Replays;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Replays;
|
|
|
|
|
using osu.Game.Rulesets.Osu.Scoring;
|
|
|
|
|
using osu.Game.Rulesets.Osu.UI.Cursor;
|
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
using osu.Game.Rulesets.UI;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.UI
|
|
|
|
|
{
|
2018-06-19 12:31:24 +00:00
|
|
|
|
public class OsuRulesetContainer : RulesetContainer<OsuPlayfield, OsuHitObject>
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2018-05-07 01:17:54 +00:00
|
|
|
|
public OsuRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
|
|
|
|
|
: base(ruleset, beatmap)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor(this);
|
|
|
|
|
|
|
|
|
|
protected override Playfield CreatePlayfield() => new OsuPlayfield();
|
|
|
|
|
|
|
|
|
|
public override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);
|
|
|
|
|
|
2018-10-03 06:36:14 +00:00
|
|
|
|
public override DrawableHitObject<OsuHitObject> GetVisualRepresentation(OsuHitObject h)
|
2018-04-13 09:19:50 +00:00
|
|
|
|
{
|
2018-07-17 05:35:09 +00:00
|
|
|
|
switch (h)
|
|
|
|
|
{
|
|
|
|
|
case HitCircle circle:
|
|
|
|
|
return new DrawableHitCircle(circle);
|
|
|
|
|
case Slider slider:
|
|
|
|
|
return new DrawableSlider(slider);
|
|
|
|
|
case Spinner spinner:
|
|
|
|
|
return new DrawableSpinner(spinner);
|
|
|
|
|
}
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new OsuReplayInputHandler(replay);
|
|
|
|
|
|
2018-07-17 05:29:22 +00:00
|
|
|
|
public override double GameplayStartTime
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
var first = (OsuHitObject)Objects.First();
|
|
|
|
|
return first.StartTime - first.TimePreempt;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-13 09:19:50 +00:00
|
|
|
|
protected override CursorContainer CreateCursor() => new GameplayCursor();
|
|
|
|
|
}
|
|
|
|
|
}
|