Update trivial components to use auto comp states (#20539)

This commit is contained in:
DrSmugleaf
2023-09-28 16:20:29 -07:00
committed by GitHub
parent 14cfe44ece
commit a44fa86b68
158 changed files with 806 additions and 2866 deletions

View File

@@ -1,35 +1,18 @@
using System.Numerics;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Placeable
namespace Content.Shared.Placeable;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(PlaceableSurfaceSystem))]
public sealed partial class PlaceableSurfaceComponent : Component
{
[RegisterComponent, NetworkedComponent]
[Access(typeof(PlaceableSurfaceSystem))]
public sealed partial class PlaceableSurfaceComponent : Component
{
[DataField("isPlaceable")]
public bool IsPlaceable { get; set; } = true;
[DataField, AutoNetworkedField]
public bool IsPlaceable { get; set; } = true;
[DataField("placeCentered")]
public bool PlaceCentered { get; set; }
[DataField, AutoNetworkedField]
public bool PlaceCentered { get; set; }
[DataField("positionOffset")]
public Vector2 PositionOffset { get; set; }
}
[Serializable, NetSerializable]
public sealed class PlaceableSurfaceComponentState : ComponentState
{
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;
}
}
[DataField, AutoNetworkedField]
public Vector2 PositionOffset { get; set; }
}