2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-04-08 17:32:05 +08:00
|
|
|
|
using System.Collections.Generic;
|
2018-07-17 13:29:22 +08:00
|
|
|
|
using System.Linq;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Framework.Input;
|
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Input.Handlers;
|
2018-11-28 16:20:37 +08:00
|
|
|
|
using osu.Game.Replays;
|
2019-04-08 17:32:05 +08:00
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2019-01-23 18:46:53 +08:00
|
|
|
|
using osu.Game.Rulesets.Osu.Configuration;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
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.Scoring;
|
|
|
|
|
using osu.Game.Rulesets.UI;
|
2019-03-25 18:21:25 +08:00
|
|
|
|
using osu.Game.Screens.Play;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.UI
|
|
|
|
|
{
|
2019-03-20 10:29:16 +08:00
|
|
|
|
public class DrawableOsuRuleset : DrawableRuleset<OsuHitObject>
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-01-25 18:14:37 +08:00
|
|
|
|
protected new OsuRulesetConfigManager Config => (OsuRulesetConfigManager)base.Config;
|
2019-01-23 18:46:53 +08:00
|
|
|
|
|
2019-04-10 16:13:12 +08:00
|
|
|
|
public DrawableOsuRuleset(Ruleset ruleset, WorkingBeatmap beatmap, IReadOnlyList<Mod> mods)
|
2019-04-08 17:32:05 +08:00
|
|
|
|
: base(ruleset, beatmap, mods)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override ScoreProcessor CreateScoreProcessor() => new OsuScoreProcessor(this);
|
|
|
|
|
|
|
|
|
|
protected override Playfield CreatePlayfield() => new OsuPlayfield();
|
|
|
|
|
|
2019-03-19 19:21:31 +08:00
|
|
|
|
protected override PassThroughInputManager CreateInputManager() => new OsuInputManager(Ruleset.RulesetInfo);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-03-31 00:29:37 +08:00
|
|
|
|
public override PlayfieldAdjustmentContainer CreatePlayfieldAdjustmentContainer() => new OsuPlayfieldAdjustmentContainer();
|
2019-03-25 18:21:01 +08:00
|
|
|
|
|
2019-03-25 18:21:25 +08:00
|
|
|
|
protected override ResumeOverlay CreateResumeOverlay() => new OsuResumeOverlay();
|
|
|
|
|
|
2019-03-24 22:40:43 +08:00
|
|
|
|
public override DrawableHitObject<OsuHitObject> CreateDrawableRepresentation(OsuHitObject h)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2018-07-17 13:35:09 +08: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 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-20 20:08:52 +08:00
|
|
|
|
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new OsuFramedReplayInputHandler(replay);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-07-17 13:29:22 +08:00
|
|
|
|
public override double GameplayStartTime
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
var first = (OsuHitObject)Objects.First();
|
|
|
|
|
return first.StartTime - first.TimePreempt;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|