Gravity generator rewrite (#4828)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Pieter-Jan Briers
2021-11-02 01:12:55 +01:00
committed by GitHub
parent 0e33b246db
commit 059fa9ae48
17 changed files with 739 additions and 361 deletions

View File

@@ -24,26 +24,31 @@ namespace Content.Shared.Gravity
}
}
/// <summary>
/// Sent to the server when requesting the status of the generator
/// </summary>
[Serializable, NetSerializable]
public class GeneratorStatusRequestMessage : BoundUserInterfaceMessage
{
public GeneratorStatusRequestMessage()
{
}
}
[Serializable, NetSerializable]
public class GeneratorState : BoundUserInterfaceState
{
public bool On;
// 0 -> 255
public byte Charge;
public GravityGeneratorPowerStatus PowerStatus;
public short PowerDraw;
public short PowerDrawMax;
public short EtaSeconds;
public GeneratorState(bool on)
public GeneratorState(
bool on,
byte charge,
GravityGeneratorPowerStatus powerStatus,
short powerDraw,
short powerDrawMax,
short etaSeconds)
{
On = on;
Charge = charge;
PowerStatus = powerStatus;
PowerDraw = powerDraw;
PowerDrawMax = powerDrawMax;
EtaSeconds = etaSeconds;
}
}
@@ -58,7 +63,7 @@ namespace Content.Shared.Gravity
public enum GravityGeneratorVisuals
{
State,
CoreVisible
Charge
}
[Serializable, NetSerializable]
@@ -69,4 +74,13 @@ namespace Content.Shared.Gravity
Off,
On
}
[Serializable, NetSerializable]
public enum GravityGeneratorPowerStatus : byte
{
Off,
Discharging,
Charging,
FullyCharged
}
}