using Content.Shared.Containers.ItemSlots;
namespace Content.Shared.PowerCell.Components;
[RegisterComponent]
public sealed class PowerCellSlotComponent : Component
{
///
/// The actual item-slot that contains the cell. Allows all the interaction logic to be handled by .
///
///
/// Given that 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.
///
[DataField("cellSlot")]
public ItemSlot CellSlot = new();
///
/// Name of the item-slot used to store cells. Determines the eject/insert verb text. E.g., "Eject > Power cell".
///
///
/// This is simply used provide a default value for . If this string is empty or
/// whitespace, the verb will instead use the full name of any cell (e.g., "eject > small super-capacity power
/// cell").
///
[DataField("slotName")]
public readonly string SlotName = "power-cell-slot-component-slot-name-default"; // gets Loc.GetString()-ed by ItemSlotsSystem
///
/// True if we don't want a cell inserted during map init. If a starting item is defined
/// in the yaml definition, that always takes precedence.
///
///
/// If false, the cell will start with a standard cell with a matching cell-size.
///
[DataField("startEmpty")]
public bool StartEmpty = false;
///
/// Descriptive text to add to add when examining an entity with a cell slot. If empty or whitespace, will not add
/// any text.
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField("descFormatString")]
public string? DescFormatString { get; set; } = "power-cell-slot-component-description-default";
///
/// Can this entity be inserted directly into a charging station? If false, you need to manually remove the power
/// cell and recharge it separately.
///
[DataField("fitsInCharger")]
public bool FitsInCharger = true;
}
///
/// Raised directed at an entity with a power cell slot when the power cell inside has its charge updated or is ejected/inserted.
///
public sealed class PowerCellChangedEvent : EntityEventArgs
{
public readonly bool Ejected;
public PowerCellChangedEvent(bool ejected)
{
Ejected = ejected;
}
}