PowerCellSlotComponent.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using Content.Shared.Containers.ItemSlots;
  2. namespace Content.Shared.PowerCell.Components;
  3. [RegisterComponent]
  4. public sealed partial class PowerCellSlotComponent : Component
  5. {
  6. /// <summary>
  7. /// The actual item-slot that contains the cell. Allows all the interaction logic to be handled by <see cref="ItemSlotsSystem"/>.
  8. /// </summary>
  9. /// <remarks>
  10. /// Given that <see cref="PowerCellSystem"/> needs to verify that a given cell has the correct cell-size before
  11. /// inserting anyways, there is no need to specify a separate entity whitelist. In this slot's yaml definition.
  12. /// </remarks>
  13. [DataField("cellSlotId", required: true)]
  14. public string CellSlotId = string.Empty;
  15. /// <summary>
  16. /// Can this entity be inserted directly into a charging station? If false, you need to manually remove the power
  17. /// cell and recharge it separately.
  18. /// </summary>
  19. [DataField("fitsInCharger")]
  20. public bool FitsInCharger = true;
  21. }
  22. /// <summary>
  23. /// Raised directed at an entity with a power cell slot when the power cell inside has its charge updated or is ejected/inserted.
  24. /// </summary>
  25. public sealed class PowerCellChangedEvent : EntityEventArgs
  26. {
  27. public readonly bool Ejected;
  28. public PowerCellChangedEvent(bool ejected)
  29. {
  30. Ejected = ejected;
  31. }
  32. }