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:
DrSmugleaf
2022-10-23 00:46:28 +02:00
committed by GitHub
parent 9a38736c3c
commit f323fb7644
140 changed files with 2478 additions and 2571 deletions

View 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;
}

View 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;
}
}

View 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;
}
}