Refactoring body system to use containers and general body cleanup (#20202)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
using Content.Shared.Body.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Body.Organ;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
[Access(typeof(SharedBodySystem))]
|
||||
public sealed partial class OrganComponent : Component
|
||||
{
|
||||
[DataField("body")]
|
||||
/// <summary>
|
||||
/// Relevant body this organ is attached to.
|
||||
/// </summary>
|
||||
[DataField("body"), AutoNetworkedField]
|
||||
public EntityUid? Body;
|
||||
|
||||
// TODO use containers. See comments in BodyPartComponent.
|
||||
// Do not rely on this in client-side code.
|
||||
public OrganSlot? ParentSlot;
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Body.Organ;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class OrganComponentState : ComponentState
|
||||
{
|
||||
public readonly NetEntity? Body;
|
||||
public readonly OrganSlot? Parent;
|
||||
|
||||
public OrganComponentState(NetEntity? body, OrganSlot? parent)
|
||||
{
|
||||
Body = body;
|
||||
Parent = parent;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
using Content.Shared.Body.Systems;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Body.Organ;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
[Access(typeof(SharedBodySystem))]
|
||||
[DataDefinition]
|
||||
public sealed partial record OrganSlot
|
||||
{
|
||||
[DataField("id")]
|
||||
public string Id = string.Empty;
|
||||
|
||||
[NonSerialized]
|
||||
[DataField("parent")]
|
||||
public EntityUid Parent;
|
||||
|
||||
public NetEntity NetParent;
|
||||
|
||||
[NonSerialized]
|
||||
[DataField("child")]
|
||||
public EntityUid? Child;
|
||||
|
||||
public NetEntity? NetChild;
|
||||
|
||||
// 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