ECS and cleanup body system, merge body templates and presets into body prototypes (#11991)
Co-authored-by: Jezithyr <Jezithyr@gmail.com>
This commit is contained in:
17
Content.Shared/Body/Organ/OrganComponent.cs
Normal file
17
Content.Shared/Body/Organ/OrganComponent.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Content.Shared.Body.Systems;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Body.Organ;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[Access(typeof(SharedBodySystem))]
|
||||
public sealed class OrganComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
[DataField("body")]
|
||||
public EntityUid? Body;
|
||||
|
||||
[ViewVariables]
|
||||
[DataField("parent")]
|
||||
public OrganSlot? ParentSlot;
|
||||
}
|
||||
16
Content.Shared/Body/Organ/OrganComponentState.cs
Normal file
16
Content.Shared/Body/Organ/OrganComponentState.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Body.Organ;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class OrganComponentState : ComponentState
|
||||
{
|
||||
public readonly EntityUid? Body;
|
||||
public readonly OrganSlot? Parent;
|
||||
|
||||
public OrganComponentState(EntityUid? body, OrganSlot? parent)
|
||||
{
|
||||
Body = body;
|
||||
Parent = parent;
|
||||
}
|
||||
}
|
||||
20
Content.Shared/Body/Organ/OrganSlot.cs
Normal file
20
Content.Shared/Body/Organ/OrganSlot.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Content.Shared.Body.Systems;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Body.Organ;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
[Access(typeof(SharedBodySystem))]
|
||||
[DataRecord]
|
||||
public sealed record OrganSlot(string Id, EntityUid Parent)
|
||||
{
|
||||
public EntityUid? Child { get; set; }
|
||||
|
||||
// Rider doesn't suggest explicit properties during deconstruction without this
|
||||
public void Deconstruct(out EntityUid? child, out string id, out EntityUid parent)
|
||||
{
|
||||
child = Child;
|
||||
id = Id;
|
||||
parent = Parent;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user