2023-07-08 14:08:32 +10:00
|
|
|
using System.Numerics;
|
2021-08-20 10:21:39 +02:00
|
|
|
using Robust.Shared.GameStates;
|
|
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Placeable
|
|
|
|
|
{
|
|
|
|
|
[RegisterComponent, NetworkedComponent]
|
2022-06-07 15:26:28 +02:00
|
|
|
[Access(typeof(PlaceableSurfaceSystem))]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class PlaceableSurfaceComponent : Component
|
2021-08-20 10:21:39 +02:00
|
|
|
{
|
|
|
|
|
[DataField("isPlaceable")]
|
|
|
|
|
public bool IsPlaceable { get; set; } = true;
|
|
|
|
|
|
|
|
|
|
[DataField("placeCentered")]
|
|
|
|
|
public bool PlaceCentered { get; set; }
|
|
|
|
|
|
|
|
|
|
[DataField("positionOffset")]
|
|
|
|
|
public Vector2 PositionOffset { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class PlaceableSurfaceComponentState : ComponentState
|
2021-08-20 10:21:39 +02:00
|
|
|
{
|
|
|
|
|
public readonly bool IsPlaceable;
|
|
|
|
|
public readonly bool PlaceCentered;
|
|
|
|
|
public readonly Vector2 PositionOffset;
|
|
|
|
|
|
|
|
|
|
public PlaceableSurfaceComponentState(bool placeable, bool centered, Vector2 offset)
|
|
|
|
|
{
|
|
|
|
|
IsPlaceable = placeable;
|
|
|
|
|
PlaceCentered = centered;
|
|
|
|
|
PositionOffset = offset;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|