WallMountComponent.cs 1.1 KB

12345678910111213141516171819202122232425262728
  1. using Robust.Shared.GameStates;
  2. namespace Content.Shared.Wall;
  3. /// <summary>
  4. /// This component enables an entity to ignore some obstructions for interaction checks.
  5. /// </summary>
  6. /// <remarks>
  7. /// This will only exempt anchored entities that intersect the wall-mount. Additionally, this exemption will apply
  8. /// in a limited arc, providing basic functionality for directional wall mounts.
  9. /// </remarks>
  10. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  11. public sealed partial class WallMountComponent : Component
  12. {
  13. /// <summary>
  14. /// Range of angles for which the exemption applies. Bigger is more permissive.
  15. /// </summary>
  16. [ViewVariables(VVAccess.ReadWrite)]
  17. [DataField("arc"), AutoNetworkedField]
  18. public Angle Arc = new(MathF.PI);
  19. /// <summary>
  20. /// The direction in which the exemption arc is facing, relative to the entity's rotation. Defaults to south.
  21. /// </summary>
  22. [ViewVariables(VVAccess.ReadWrite)]
  23. [DataField("direction"), AutoNetworkedField]
  24. public Angle Direction = Angle.Zero;
  25. }