using Content.Server.Gravity.EntitySystems;
using Content.Shared.Gravity;
namespace Content.Server.Gravity
{
[RegisterComponent]
[Friend(typeof(GravityGeneratorSystem))]
public sealed class GravityGeneratorComponent : SharedGravityGeneratorComponent
{
// 1% charge per second.
[ViewVariables(VVAccess.ReadWrite)] [DataField("chargeRate")] public float ChargeRate { get; set; } = 0.01f;
// The gravity generator has two power values.
// Idle power is assumed to be the power needed to run the control systems and interface.
[DataField("idlePower")] public float IdlePowerUse { get; set; }
// Active power is the power needed to keep the gravity field stable.
[DataField("activePower")] public float ActivePowerUse { get; set; }
[DataField("lightRadiusMin")] public float LightRadiusMin { get; set; }
[DataField("lightRadiusMax")] public float LightRadiusMax { get; set; }
///
/// Is the power switch on?
///
[DataField("switchedOn")]
public bool SwitchedOn { get; set; } = true;
///
/// Is the gravity generator intact?
///
[DataField("intact")]
public bool Intact { get; set; } = true;
// 0 -> 1
[ViewVariables(VVAccess.ReadWrite)] [DataField("charge")] public float Charge { get; set; } = 1;
///
/// Is the gravity generator currently "producing" gravity?
///
[DataField("active")]
public bool GravityActive { get; set; } = true;
// Do we need a UI update even if the charge doesn't change? Used by power button.
[ViewVariables] public bool NeedUIUpdate { get; set; }
[ViewVariables] public bool NeedGravityUpdate { get; set; }
}
}