PilotedClothingComponent.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using Content.Shared.Whitelist;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Shared.Clothing.Components;
  4. /// <summary>
  5. /// Allows an entity stored in this clothing item to pass inputs to the entity wearing it.
  6. /// </summary>
  7. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  8. public sealed partial class PilotedClothingComponent : Component
  9. {
  10. /// <summary>
  11. /// Whitelist for entities that are allowed to act as pilots when inside this entity.
  12. /// </summary>
  13. [DataField]
  14. public EntityWhitelist? PilotWhitelist;
  15. /// <summary>
  16. /// Should movement input be relayed from the pilot to the target?
  17. /// </summary>
  18. [DataField]
  19. public bool RelayMovement = true;
  20. /// <summary>
  21. /// Reference to the entity contained in the clothing and acting as pilot.
  22. /// </summary>
  23. [DataField, AutoNetworkedField]
  24. public EntityUid? Pilot;
  25. /// <summary>
  26. /// Reference to the entity wearing this clothing who will be controlled by the pilot.
  27. /// </summary>
  28. [DataField, AutoNetworkedField]
  29. public EntityUid? Wearer;
  30. public bool IsActive => Pilot != null && Wearer != null;
  31. }