mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 04:42:55 +08:00
45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
|
// 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.
|
||
|
|
||
|
using osu.Game.Rulesets.Objects;
|
||
|
using osu.Game.Rulesets.Objects.Types;
|
||
|
using osu.Game.Screens.Edit.Commands;
|
||
|
using osuTK;
|
||
|
|
||
|
namespace osu.Game.Rulesets.Osu.Edit.Commands
|
||
|
{
|
||
|
public class UpdateControlPointCommand : IEditorCommand
|
||
|
{
|
||
|
public PathControlPoint ControlPoint;
|
||
|
|
||
|
public Vector2 Position;
|
||
|
|
||
|
public PathType? Type;
|
||
|
|
||
|
public UpdateControlPointCommand(PathControlPoint controlPoint)
|
||
|
{
|
||
|
ControlPoint = controlPoint;
|
||
|
Position = controlPoint.Position;
|
||
|
Type = controlPoint.Type;
|
||
|
}
|
||
|
|
||
|
public UpdateControlPointCommand(PathControlPoint controlPoint, Vector2 position, PathType? type)
|
||
|
{
|
||
|
ControlPoint = controlPoint;
|
||
|
Position = position;
|
||
|
Type = type;
|
||
|
}
|
||
|
|
||
|
public void Apply()
|
||
|
{
|
||
|
ControlPoint.Position = Position;
|
||
|
ControlPoint.Type = Type;
|
||
|
}
|
||
|
|
||
|
public IEditorCommand CreateUndo()
|
||
|
{
|
||
|
return new UpdateControlPointCommand(ControlPoint, ControlPoint.Position, ControlPoint.Type);
|
||
|
}
|
||
|
}
|
||
|
}
|