1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-23 16:47:26 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs

59 lines
2.2 KiB
C#
Raw Normal View History

2018-04-13 17:19:50 +08:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic;
using osu.Framework.Graphics;
2018-09-21 13:02:32 +08:00
using osu.Framework.Graphics.Containers;
2018-04-13 17:19:50 +08:00
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Edit.Tools;
using osu.Game.Rulesets.Objects.Drawables;
2018-11-07 15:08:56 +08: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;
using osu.Game.Rulesets.Osu.Objects;
2018-04-13 17:19:50 +08:00
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;
using osu.Game.Screens.Edit.Compose.Components;
2018-04-13 17:19:50 +08:00
namespace osu.Game.Rulesets.Osu.Edit
{
public class OsuHitObjectComposer : HitObjectComposer<OsuHitObject>
2018-04-13 17:19:50 +08:00
{
public OsuHitObjectComposer(Ruleset ruleset)
: base(ruleset)
{
}
protected override RulesetContainer<OsuHitObject> CreateRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
=> new OsuEditRulesetContainer(ruleset, beatmap);
2018-04-13 17:19:50 +08:00
protected override IReadOnlyList<HitObjectCompositionTool> CompositionTools => new HitObjectCompositionTool[]
2018-04-13 17:19:50 +08:00
{
new HitCircleCompositionTool(),
new SliderCompositionTool(),
2018-10-29 17:35:46 +08:00
new SpinnerCompositionTool()
2018-04-13 17:19:50 +08:00
};
2018-11-19 15:58:11 +08:00
public override SelectionHandler CreateSelectionHandler() => new OsuSelectionHandler();
protected override Container CreateLayerContainer() => new PlayfieldAdjustmentContainer { RelativeSizeAxes = Axes.Both };
2018-04-13 17:19:50 +08:00
2018-11-06 17:03:21 +08:00
public override SelectionBlueprint CreateBlueprintFor(DrawableHitObject hitObject)
2018-04-13 17:19:50 +08:00
{
switch (hitObject)
{
case DrawableHitCircle circle:
2018-11-06 16:56:04 +08:00
return new HitCircleSelectionBlueprint(circle);
2018-04-13 17:19:50 +08:00
case DrawableSlider slider:
2018-11-06 16:56:04 +08:00
return new SliderSelectionBlueprint(slider);
2018-10-29 17:23:23 +08:00
case DrawableSpinner spinner:
2018-11-06 16:56:04 +08:00
return new SpinnerSelectionBlueprint(spinner);
2018-04-13 17:19:50 +08:00
}
2018-11-06 17:03:21 +08:00
return base.CreateBlueprintFor(hitObject);
2018-04-13 17:19:50 +08:00
}
}
}