6
StarHorizon_Public/Content.Shared/Power/SharedPowerCharge.cs
2025-08-05 10:00:54 +03:00

87 lines
1.8 KiB
C#

using Robust.Shared.Serialization;
namespace Content.Shared.Power;
/// <summary>
/// Frontier: Sent to the server to perform some action with the charge in the machine.
/// </summary>
[Serializable, NetSerializable]
public sealed class PowerChargeActionMessage : BoundUserInterfaceMessage { }
/// <summary>
/// Sent to the server to set whether the machine should be on or off
/// </summary>
[Serializable, NetSerializable]
public sealed class SwitchChargingMachineMessage : BoundUserInterfaceMessage
{
public bool On;
public SwitchChargingMachineMessage(bool on)
{
On = on;
}
}
[Serializable, NetSerializable]
public sealed class PowerChargeState : BoundUserInterfaceState
{
public bool On;
public bool ActionUnlocked; // Frontier
// 0 -> 255
public byte Charge;
public PowerChargePowerStatus PowerStatus;
public short PowerDraw;
public short PowerDrawMax;
public short EtaSeconds;
public PowerChargeState(
bool on,
bool actionUnlocked, // Frontier
byte charge,
PowerChargePowerStatus powerStatus,
short powerDraw,
short powerDrawMax,
short etaSeconds)
{
On = on;
ActionUnlocked = actionUnlocked; // Frontier
Charge = charge;
PowerStatus = powerStatus;
PowerDraw = powerDraw;
PowerDrawMax = powerDrawMax;
EtaSeconds = etaSeconds;
}
}
[Serializable, NetSerializable]
public enum PowerChargeUiKey
{
Key
}
[Serializable, NetSerializable]
public enum PowerChargeVisuals
{
State,
Charge,
Active
}
[Serializable, NetSerializable]
public enum PowerChargeStatus
{
Broken,
Unpowered,
Off,
On
}
[Serializable, NetSerializable]
public enum PowerChargePowerStatus : byte
{
Off,
Discharging,
Charging,
FullyCharged
}