using Content.Server.Power.EntitySystems; using Content.Shared.Power; namespace Content.Server.Power.Components; /// [RegisterComponent] [Access(typeof(PowerChargeSystem))] public sealed partial class PowerChargeComponent : SharedPowerChargeComponent { /// /// Change in charge per second. /// [DataField] public float ChargeRate { get; set; } = 0.01f; /// /// Baseline power that this machine consumes. /// [DataField("idlePower")] public float IdlePowerUse { get; set; } /// /// Power consumed when is true. /// [DataField("activePower")] public float ActivePowerUse { get; set; } /// /// Is the gravity generator intact? /// [DataField] public bool Intact { get; set; } = true; /// /// Is the power switch on? /// [DataField] public bool SwitchedOn { get; set; } = true; /// /// Whether or not the power is switched on and the entity has charged up. /// [DataField] public bool Active { get; set; } [DataField] public float MaxCharge { get; set; } = 1; /// /// The UI key of the UI that's used with this machine.
/// This is used to allow machine power charging to be integrated into any ui ///
[DataField, ViewVariables(VVAccess.ReadOnly)] public Enum UiKey { get; set; } = PowerChargeUiKey.Key; /// /// Current charge value. /// Goes from 0 to 1. /// [DataField] public float Charge { get; set; } = 1; [ViewVariables] public bool NeedUIUpdate { get; set; } }