Fix foldable-pickup interactions. (#6057)

This commit is contained in:
Leon Friedrich
2022-01-07 19:09:42 +13:00
committed by GitHub
parent 106f176d13
commit c29489ff4d
10 changed files with 145 additions and 106 deletions

View File

@@ -0,0 +1,35 @@
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
using System;
namespace Content.Shared.Foldable;
/// <summary>
/// Used to create "foldable structures" that you can pickup like an item when folded. Used for rollerbeds and wheelchairs
/// </summary>
[RegisterComponent]
[NetworkedComponent]
[Friend(typeof(SharedFoldableSystem))]
public class FoldableComponent : Component
{
public override string Name => "Foldable";
[DataField("folded")]
public bool IsFolded = false;
}
// ahhh, the ol' "state thats just a copy of the component".
[Serializable, NetSerializable]
public class FoldableComponentState : ComponentState
{
public readonly bool IsFolded;
public FoldableComponentState(bool isFolded)
{
IsFolded = isFolded;
}
}