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-10-26 12:39:19 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Edit.Masks.HitCircleMasks;
|
|
|
|
using osu.Game.Rulesets.Osu.Edit.Masks.SliderMasks;
|
2018-10-17 17:01:38 +08:00
|
|
|
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;
|
2018-10-17 17:01:38 +08:00
|
|
|
using osu.Game.Rulesets.UI;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Edit
|
|
|
|
{
|
2018-10-17 17:01:38 +08:00
|
|
|
public class OsuHitObjectComposer : HitObjectComposer<OsuHitObject>
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
|
|
|
public OsuHitObjectComposer(Ruleset ruleset)
|
|
|
|
: base(ruleset)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-10-17 17:01:38 +08:00
|
|
|
protected override RulesetContainer<OsuHitObject> CreateRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap)
|
|
|
|
=> new OsuEditRulesetContainer(ruleset, beatmap);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2018-10-03 15:27:26 +08:00
|
|
|
protected override IReadOnlyList<HitObjectCompositionTool> CompositionTools => new[]
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
2018-10-03 15:27:26 +08:00
|
|
|
new HitCircleCompositionTool(),
|
2018-04-13 17:19:50 +08:00
|
|
|
};
|
|
|
|
|
2018-10-05 09:39:18 +08:00
|
|
|
protected override Container CreateLayerContainer() => new PlayfieldAdjustmentContainer { RelativeSizeAxes = Axes.Both };
|
2018-04-13 17:19:50 +08:00
|
|
|
|
2018-10-03 12:28:00 +08:00
|
|
|
public override SelectionMask CreateMaskFor(DrawableHitObject hitObject)
|
2018-04-13 17:19:50 +08:00
|
|
|
{
|
|
|
|
switch (hitObject)
|
|
|
|
{
|
|
|
|
case DrawableHitCircle circle:
|
2018-10-03 12:28:00 +08:00
|
|
|
return new HitCircleSelectionMask(circle);
|
2018-04-13 17:19:50 +08:00
|
|
|
case DrawableSlider slider:
|
2018-10-03 12:28:00 +08:00
|
|
|
return new SliderSelectionMask(slider);
|
2018-04-13 17:19:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return base.CreateMaskFor(hitObject);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|