2021-02-27 04:12:09 +01:00
|
|
|
using System;
|
2020-05-02 15:02:52 +01:00
|
|
|
using Robust.Shared.GameObjects;
|
2021-07-12 01:32:10 -07:00
|
|
|
using Robust.Shared.GameStates;
|
2020-05-02 15:02:52 +01:00
|
|
|
using Robust.Shared.Serialization;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Shared.Gravity
|
2020-05-02 15:02:52 +01:00
|
|
|
{
|
2021-07-12 01:32:10 -07:00
|
|
|
[NetworkedComponent()]
|
2022-02-16 00:23:23 -07:00
|
|
|
[Virtual]
|
2020-10-18 13:08:41 +02:00
|
|
|
public class SharedGravityGeneratorComponent : Component
|
2020-05-02 15:02:52 +01:00
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Sent to the server to set whether the generator should be on or off
|
|
|
|
|
/// </summary>
|
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class SwitchGeneratorMessage : BoundUserInterfaceMessage
|
2020-05-02 15:02:52 +01:00
|
|
|
{
|
|
|
|
|
public bool On;
|
|
|
|
|
|
|
|
|
|
public SwitchGeneratorMessage(bool on)
|
|
|
|
|
{
|
|
|
|
|
On = on;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class GeneratorState : BoundUserInterfaceState
|
2020-05-02 15:02:52 +01:00
|
|
|
{
|
|
|
|
|
public bool On;
|
2021-11-02 01:12:55 +01:00
|
|
|
// 0 -> 255
|
|
|
|
|
public byte Charge;
|
|
|
|
|
public GravityGeneratorPowerStatus PowerStatus;
|
|
|
|
|
public short PowerDraw;
|
|
|
|
|
public short PowerDrawMax;
|
|
|
|
|
public short EtaSeconds;
|
2020-05-02 15:02:52 +01:00
|
|
|
|
2021-11-02 01:12:55 +01:00
|
|
|
public GeneratorState(
|
|
|
|
|
bool on,
|
|
|
|
|
byte charge,
|
|
|
|
|
GravityGeneratorPowerStatus powerStatus,
|
|
|
|
|
short powerDraw,
|
|
|
|
|
short powerDrawMax,
|
|
|
|
|
short etaSeconds)
|
2020-05-02 15:02:52 +01:00
|
|
|
{
|
|
|
|
|
On = on;
|
2021-11-02 01:12:55 +01:00
|
|
|
Charge = charge;
|
|
|
|
|
PowerStatus = powerStatus;
|
|
|
|
|
PowerDraw = powerDraw;
|
|
|
|
|
PowerDrawMax = powerDrawMax;
|
|
|
|
|
EtaSeconds = etaSeconds;
|
2020-05-02 15:02:52 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public enum GravityGeneratorUiKey
|
|
|
|
|
{
|
|
|
|
|
Key
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-18 13:08:41 +02:00
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public enum GravityGeneratorVisuals
|
|
|
|
|
{
|
|
|
|
|
State,
|
2021-11-02 01:12:55 +01:00
|
|
|
Charge
|
2020-10-18 13:08:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public enum GravityGeneratorStatus
|
|
|
|
|
{
|
|
|
|
|
Broken,
|
|
|
|
|
Unpowered,
|
|
|
|
|
Off,
|
|
|
|
|
On
|
|
|
|
|
}
|
2021-11-02 01:12:55 +01:00
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public enum GravityGeneratorPowerStatus : byte
|
|
|
|
|
{
|
|
|
|
|
Off,
|
|
|
|
|
Discharging,
|
|
|
|
|
Charging,
|
|
|
|
|
FullyCharged
|
|
|
|
|
}
|
2020-05-02 15:02:52 +01:00
|
|
|
}
|