2022-01-05 17:20:25 +13:00
|
|
|
using Content.Shared.Containers.ItemSlots;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.PowerCell.Components;
|
|
|
|
|
|
|
|
|
|
[RegisterComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class PowerCellSlotComponent : Component
|
2022-01-05 17:20:25 +13:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The actual item-slot that contains the cell. Allows all the interaction logic to be handled by <see cref="ItemSlotsSystem"/>.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <remarks>
|
|
|
|
|
/// Given that <see cref="PowerCellSystem"/> needs to verify that a given cell has the correct cell-size before
|
|
|
|
|
/// inserting anyways, there is no need to specify a separate entity whitelist. In this slot's yaml definition.
|
|
|
|
|
/// </remarks>
|
2022-10-15 13:15:39 -07:00
|
|
|
[DataField("cellSlotId", required: true)]
|
|
|
|
|
public string CellSlotId = string.Empty;
|
2022-01-05 17:20:25 +13:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Can this entity be inserted directly into a charging station? If false, you need to manually remove the power
|
|
|
|
|
/// cell and recharge it separately.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("fitsInCharger")]
|
|
|
|
|
public bool FitsInCharger = true;
|
2022-10-15 13:15:39 -07:00
|
|
|
|
2022-01-05 17:20:25 +13:00
|
|
|
}
|
|
|
|
|
|
2022-01-10 01:48:58 +13:00
|
|
|
/// <summary>
|
|
|
|
|
/// Raised directed at an entity with a power cell slot when the power cell inside has its charge updated or is ejected/inserted.
|
|
|
|
|
/// </summary>
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class PowerCellChangedEvent : EntityEventArgs
|
2022-01-05 17:20:25 +13:00
|
|
|
{
|
|
|
|
|
public readonly bool Ejected;
|
|
|
|
|
|
|
|
|
|
public PowerCellChangedEvent(bool ejected)
|
|
|
|
|
{
|
|
|
|
|
Ejected = ejected;
|
|
|
|
|
}
|
|
|
|
|
}
|