using Content.Shared.Power.EntitySystems;
using Robust.Shared.GameStates;
namespace Content.Shared.Power.Components;
///
/// Attached to APC powered entities that possess a rechargeable internal battery.
/// If external power is interrupted, the entity will draw power from this battery instead.
/// Requires and to function.
///
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedPowerNetSystem), typeof(SharedPowerReceiverSystem))]
public sealed partial class ApcPowerReceiverBatteryComponent : Component
{
///
/// Indicates whether power is currently being drawn from the battery.
///
[DataField, AutoNetworkedField]
public bool Enabled = false;
///
/// The passive load the entity places on the APC power network.
/// If not connected to an active APC power network, this amount
/// of power is drained from the battery every second.
///
[DataField]
public float IdleLoad = 5f;
///
/// Determines how much battery charge the entity's battery gains
/// per second when connected to an active APC power network.
///
[DataField]
public float BatteryRechargeRate = 50f;
///
/// While the battery is being recharged, the load this entity places on the APC
/// power network is increased by the multiplied
/// by this factor.
///
[DataField]
public float BatteryRechargeEfficiency = 1f;
}
///
/// Raised whenever an ApcPowerReceiverBattery starts / stops discharging
///
[ByRefEvent]
public readonly record struct ApcPowerReceiverBatteryChangedEvent(bool Enabled);