using Content.Shared.Atmos;
using Content.Shared.Guidebook;
using Robust.Shared.GameStates;
namespace Content.Shared.Atmos.Piping.Unary.Components
{
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
public sealed partial class GasThermoMachineComponent : Component
{
[DataField("inlet")]
public string InletName = "pipe";
///
/// Current electrical power consumption, in watts. Increasing power increases the ability of the
/// thermomachine to heat or cool air.
///
[DataField]
[GuidebookData]
public float HeatCapacity = 5000;
[DataField, AutoNetworkedField]
public float TargetTemperature = Atmospherics.T20C;
///
/// Tolerance for temperature setpoint hysteresis.
///
[GuidebookData]
[DataField, ViewVariables(VVAccess.ReadOnly)]
public float TemperatureTolerance = 2f;
///
/// Implements setpoint hysteresis to prevent heater from rapidly cycling on and off at setpoint.
/// If true, add Sign(Cp)*TemperatureTolerance to the temperature setpoint.
///
[ViewVariables(VVAccess.ReadOnly)]
public bool HysteresisState;
///
/// Coefficient of performance. Output power / input power.
/// Positive for heaters, negative for freezers.
///
[DataField("coefficientOfPerformance")]
public float Cp = 0.9f; // output power / input power, positive is heat
///
/// Current minimum temperature
/// Ignored if heater.
///
[DataField, AutoNetworkedField]
[GuidebookData]
public float MinTemperature = 73.15f;
///
/// Current maximum temperature
/// Ignored if freezer.
///
[DataField, AutoNetworkedField]
[GuidebookData]
public float MaxTemperature = 593.15f;
///
/// Last amount of energy added/removed from the attached pipe network
///
[DataField]
public float LastEnergyDelta;
///
/// An percentage of the energy change that is leaked into the surrounding environment rather than the inlet pipe.
///
[DataField]
[GuidebookData]
public float EnergyLeakPercentage;
///
/// If true, heat is exclusively exchanged with the local atmosphere instead of the inlet pipe air
///
[DataField]
public bool Atmospheric;
}
}