ItemPlacerComponent.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. using Content.Shared.Whitelist;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Shared.Placeable;
  4. /// <summary>
  5. /// Detects items placed on it that match a whitelist.
  6. /// </summary>
  7. [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
  8. [Access(typeof(ItemPlacerSystem))]
  9. public sealed partial class ItemPlacerComponent : Component
  10. {
  11. /// <summary>
  12. /// The entities that are currently on top of the placer.
  13. /// Guaranteed to have less than <see cref="MaxEntities"/> enitities if it is set.
  14. /// </summary>
  15. [DataField, AutoNetworkedField]
  16. public HashSet<EntityUid> PlacedEntities = new();
  17. /// <summary>
  18. /// Whitelist for entities that can be placed.
  19. /// </summary>
  20. [DataField, ViewVariables(VVAccess.ReadWrite)]
  21. public EntityWhitelist? Whitelist;
  22. /// <summary>
  23. /// The max amount of entities that can be placed at the same time.
  24. /// If 0, there is no limit.
  25. /// </summary>
  26. [ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
  27. public uint MaxEntities = 1;
  28. }