2019-01-24 08:43:03 +00: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 09:19:50 +00:00
|
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Rulesets.Edit;
|
|
|
|
using osu.Game.Rulesets.Edit.Tools;
|
2019-04-08 09:32:05 +00:00
|
|
|
using osu.Game.Rulesets.Mods;
|
2018-04-13 09:19:50 +00:00
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
2018-11-07 07:08:56 +00:00
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.HitCircles;
|
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders;
|
|
|
|
using osu.Game.Rulesets.Osu.Edit.Blueprints.Spinners;
|
2018-10-17 09:01:38 +00:00
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2018-04-13 09:19:50 +00:00
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
2018-10-17 09:01:38 +00:00
|
|
|
using osu.Game.Rulesets.UI;
|
2018-11-16 08:12:24 +00:00
|
|
|
using osu.Game.Screens.Edit.Compose.Components;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Edit
|
|
|
|
{
|
2018-10-17 09:01:38 +00:00
|
|
|
public class OsuHitObjectComposer : HitObjectComposer<OsuHitObject>
|
2018-04-13 09:19:50 +00:00
|
|
|
{
|
|
|
|
public OsuHitObjectComposer(Ruleset ruleset)
|
|
|
|
: base(ruleset)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-08-29 10:40:56 +00:00
|
|
|
protected override DrawableRuleset<OsuHitObject> CreateDrawableRuleset(Ruleset ruleset, IWorkingBeatmap beatmap, IReadOnlyList<Mod> mods)
|
2019-04-08 09:32:05 +00:00
|
|
|
=> new DrawableOsuEditRuleset(ruleset, beatmap, mods);
|
2018-04-13 09:19:50 +00:00
|
|
|
|
2018-10-04 04:44:49 +00:00
|
|
|
protected override IReadOnlyList<HitObjectCompositionTool> CompositionTools => new HitObjectCompositionTool[]
|
2018-04-13 09:19:50 +00:00
|
|
|
{
|
2018-10-03 07:27:26 +00:00
|
|
|
new HitCircleCompositionTool(),
|
2018-10-04 04:44:49 +00:00
|
|
|
new SliderCompositionTool(),
|
2018-10-29 09:35:46 +00:00
|
|
|
new SpinnerCompositionTool()
|
2018-04-13 09:19:50 +00:00
|
|
|
};
|
|
|
|
|
2018-11-19 07:58:11 +00:00
|
|
|
public override SelectionHandler CreateSelectionHandler() => new OsuSelectionHandler();
|
2018-11-16 08:12:24 +00:00
|
|
|
|
2018-11-06 09:03:21 +00:00
|
|
|
public override SelectionBlueprint CreateBlueprintFor(DrawableHitObject hitObject)
|
2018-04-13 09:19:50 +00:00
|
|
|
{
|
|
|
|
switch (hitObject)
|
|
|
|
{
|
|
|
|
case DrawableHitCircle circle:
|
2018-11-06 08:56:04 +00:00
|
|
|
return new HitCircleSelectionBlueprint(circle);
|
2019-04-01 03:44:46 +00:00
|
|
|
|
2018-04-13 09:19:50 +00:00
|
|
|
case DrawableSlider slider:
|
2018-11-06 08:56:04 +00:00
|
|
|
return new SliderSelectionBlueprint(slider);
|
2019-04-01 03:44:46 +00:00
|
|
|
|
2018-10-29 09:23:23 +00:00
|
|
|
case DrawableSpinner spinner:
|
2018-11-06 08:56:04 +00:00
|
|
|
return new SpinnerSelectionBlueprint(spinner);
|
2018-04-13 09:19:50 +00:00
|
|
|
}
|
|
|
|
|
2018-11-06 09:03:21 +00:00
|
|
|
return base.CreateBlueprintFor(hitObject);
|
2018-04-13 09:19:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|