mirror of
https://github.com/ppy/osu.git
synced 2025-01-18 10:43:22 +08:00
Add setters to hitobject coordinate interfaces
This commit is contained in:
parent
0c02369bdc
commit
0d16ed028b
@ -14,7 +14,16 @@ namespace osu.Game.Rulesets.EmptyFreeform.Objects
|
|||||||
|
|
||||||
public Vector2 Position { get; set; }
|
public Vector2 Position { get; set; }
|
||||||
|
|
||||||
public float X => Position.X;
|
public float X
|
||||||
public float Y => Position.Y;
|
{
|
||||||
|
get => Position.X;
|
||||||
|
set => Position = new Vector2(value, Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public float Y
|
||||||
|
{
|
||||||
|
get => Position.Y;
|
||||||
|
set => Position = new Vector2(X, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,16 @@ namespace osu.Game.Rulesets.Pippidon.Objects
|
|||||||
|
|
||||||
public Vector2 Position { get; set; }
|
public Vector2 Position { get; set; }
|
||||||
|
|
||||||
public float X => Position.X;
|
public float X
|
||||||
public float Y => Position.Y;
|
{
|
||||||
|
get => Position.X;
|
||||||
|
set => Position = new Vector2(value, Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public float Y
|
||||||
|
{
|
||||||
|
get => Position.Y;
|
||||||
|
set => Position = new Vector2(X, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -210,11 +210,27 @@ namespace osu.Game.Rulesets.Catch.Objects
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public float LegacyConvertedY { get; set; } = DEFAULT_LEGACY_CONVERT_Y;
|
public float LegacyConvertedY { get; set; } = DEFAULT_LEGACY_CONVERT_Y;
|
||||||
|
|
||||||
float IHasXPosition.X => OriginalX;
|
float IHasXPosition.X
|
||||||
|
{
|
||||||
|
get => OriginalX;
|
||||||
|
set => OriginalX = value;
|
||||||
|
}
|
||||||
|
|
||||||
float IHasYPosition.Y => LegacyConvertedY;
|
float IHasYPosition.Y
|
||||||
|
{
|
||||||
|
get => LegacyConvertedY;
|
||||||
|
set => LegacyConvertedY = value;
|
||||||
|
}
|
||||||
|
|
||||||
Vector2 IHasPosition.Position => new Vector2(OriginalX, LegacyConvertedY);
|
Vector2 IHasPosition.Position
|
||||||
|
{
|
||||||
|
get => new Vector2(OriginalX, LegacyConvertedY);
|
||||||
|
set
|
||||||
|
{
|
||||||
|
((IHasXPosition)this).X = value.X;
|
||||||
|
((IHasYPosition)this).Y = value.Y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,11 @@ namespace osu.Game.Rulesets.Mania.Objects
|
|||||||
|
|
||||||
#region LegacyBeatmapEncoder
|
#region LegacyBeatmapEncoder
|
||||||
|
|
||||||
float IHasXPosition.X => Column;
|
float IHasXPosition.X
|
||||||
|
{
|
||||||
|
get => Column;
|
||||||
|
set => Column = (int)value;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
@ -59,8 +59,17 @@ namespace osu.Game.Rulesets.Osu.Objects
|
|||||||
set => position.Value = value;
|
set => position.Value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float X => Position.X;
|
public float X
|
||||||
public float Y => Position.Y;
|
{
|
||||||
|
get => Position.X;
|
||||||
|
set => Position = new Vector2(value, Position.Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public float Y
|
||||||
|
{
|
||||||
|
get => Position.Y;
|
||||||
|
set => Position = new Vector2(Position.X, value);
|
||||||
|
}
|
||||||
|
|
||||||
public Vector2 StackedPosition => Position + StackOffset;
|
public Vector2 StackedPosition => Position + StackOffset;
|
||||||
|
|
||||||
|
@ -21,9 +21,17 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
|||||||
|
|
||||||
public int ComboOffset { get; set; }
|
public int ComboOffset { get; set; }
|
||||||
|
|
||||||
public float X => Position.X;
|
public float X
|
||||||
|
{
|
||||||
|
get => Position.X;
|
||||||
|
set => Position = new Vector2(value, Position.Y);
|
||||||
|
}
|
||||||
|
|
||||||
public float Y => Position.Y;
|
public float Y
|
||||||
|
{
|
||||||
|
get => Position.Y;
|
||||||
|
set => Position = new Vector2(Position.X, value);
|
||||||
|
}
|
||||||
|
|
||||||
public Vector2 Position { get; set; }
|
public Vector2 Position { get; set; }
|
||||||
|
|
||||||
|
@ -13,6 +13,6 @@ namespace osu.Game.Rulesets.Objects.Types
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The starting position of the HitObject.
|
/// The starting position of the HitObject.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Vector2 Position { get; }
|
Vector2 Position { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,6 @@ namespace osu.Game.Rulesets.Objects.Types
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The starting X-position of this HitObject.
|
/// The starting X-position of this HitObject.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
float X { get; }
|
float X { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,6 @@ namespace osu.Game.Rulesets.Objects.Types
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The starting Y-position of this HitObject.
|
/// The starting Y-position of this HitObject.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
float Y { get; }
|
float Y { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user