1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 07:27:33 +08:00
osu-lazer/osu.Game.Rulesets.Osu/Edit/OsuHitObjectComposer.cs

50 lines
1.8 KiB
C#
Raw Normal View History

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
using System.Collections.Generic;
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;
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;
using osu.Game.Rulesets.Osu.Objects;
2018-03-14 14:18:21 +08:00
using osu.Game.Rulesets.Osu.Objects.Drawables;
using osu.Game.Rulesets.Osu.UI;
2017-11-30 18:19:34 +08:00
using osu.Game.Rulesets.UI;
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
{
public OsuHitObjectComposer(Ruleset ruleset)
: base(ruleset)
{
}
2017-11-30 18:19:34 +08:00
protected override RulesetContainer CreateRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap) => new OsuEditRulesetContainer(ruleset, beatmap, true);
protected override IReadOnlyList<ICompositionTool> CompositionTools => new ICompositionTool[]
{
new HitObjectCompositionTool<HitCircle>(),
new HitObjectCompositionTool<Slider>(),
new HitObjectCompositionTool<Spinner>()
};
protected override ScalableContainer CreateLayerContainer() => new ScalableContainer(OsuPlayfield.BASE_SIZE.X) { RelativeSizeAxes = Axes.Both };
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
}
}