2018-01-05 19:21:19 +08:00
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
2017-11-29 15:22:11 +08:00
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
2017-11-30 15:58:14 +08:00
|
|
|
using System.Collections.Generic;
|
2018-02-20 13:01:33 +08:00
|
|
|
using osu.Framework.Graphics;
|
2017-11-30 18:19:34 +08:00
|
|
|
using osu.Game.Beatmaps;
|
2017-11-30 17:48:00 +08:00
|
|
|
using osu.Game.Rulesets.Edit;
|
2017-11-30 15:58:14 +08:00
|
|
|
using osu.Game.Rulesets.Edit.Tools;
|
2018-03-14 14:18:21 +08:00
|
|
|
using osu.Game.Rulesets.Objects.Drawables;
|
|
|
|
using osu.Game.Rulesets.Osu.Edit.Layers.Selection.Overlays;
|
2017-11-30 15:58:14 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
2018-03-14 14:18:21 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Objects.Drawables;
|
2018-02-20 13:01:33 +08:00
|
|
|
using osu.Game.Rulesets.Osu.UI;
|
2017-11-30 18:19:34 +08:00
|
|
|
using osu.Game.Rulesets.UI;
|
2017-11-30 15:58:14 +08:00
|
|
|
|
2017-11-29 15:22:11 +08:00
|
|
|
namespace osu.Game.Rulesets.Osu.Edit
|
|
|
|
{
|
2017-11-30 17:48:00 +08:00
|
|
|
public class OsuHitObjectComposer : HitObjectComposer
|
2017-11-29 15:22:11 +08:00
|
|
|
{
|
2017-11-29 16:46:12 +08:00
|
|
|
public OsuHitObjectComposer(Ruleset ruleset)
|
|
|
|
: base(ruleset)
|
|
|
|
{
|
|
|
|
}
|
2017-11-30 15:58:14 +08:00
|
|
|
|
2017-11-30 18:19:34 +08:00
|
|
|
protected override RulesetContainer CreateRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) => new OsuEditRulesetContainer(ruleset, beatmap, true);
|
|
|
|
|
2017-11-30 15:58:14 +08:00
|
|
|
protected override IReadOnlyList<ICompositionTool> CompositionTools => new ICompositionTool[]
|
|
|
|
{
|
|
|
|
new HitObjectCompositionTool<HitCircle>(),
|
|
|
|
new HitObjectCompositionTool<Slider>(),
|
|
|
|
new HitObjectCompositionTool<Spinner>()
|
|
|
|
};
|
2018-02-20 13:01:33 +08:00
|
|
|
|
|
|
|
protected override ScalableContainer CreateLayerContainer() => new ScalableContainer(OsuPlayfield.BASE_SIZE.X) { RelativeSizeAxes = Axes.Both };
|
2018-02-20 17:01:45 +08:00
|
|
|
|
2018-03-14 14:18:21 +08:00
|
|
|
public override HitObjectMask CreateMaskFor(DrawableHitObject hitObject)
|
|
|
|
{
|
|
|
|
switch (hitObject)
|
|
|
|
{
|
|
|
|
case DrawableHitCircle circle:
|
|
|
|
return new HitCircleMask(circle);
|
|
|
|
case DrawableSlider slider:
|
|
|
|
return new SliderMask(slider);
|
|
|
|
}
|
|
|
|
|
|
|
|
return base.CreateMaskFor(hitObject);
|
|
|
|
}
|
2017-11-29 15:22:11 +08:00
|
|
|
}
|
|
|
|
}
|