Files
crystall-punk-14/Content.Shared/Gravity/SharedGravityGeneratorComponent.cs

86 lines
2.1 KiB
C#
Raw Normal View History

using System;
2020-05-02 15:02:52 +01:00
using Robust.Shared.GameObjects;
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
{
[NetworkedComponent()]
[Virtual]
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]
public sealed class SwitchGeneratorMessage : BoundUserInterfaceMessage
2020-05-02 15:02:52 +01:00
{
public bool On;
public SwitchGeneratorMessage(bool on)
{
On = on;
}
}
[Serializable, NetSerializable]
public sealed class GeneratorState : BoundUserInterfaceState
2020-05-02 15:02:52 +01:00
{
public bool On;
// 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
public GeneratorState(
bool on,
byte charge,
GravityGeneratorPowerStatus powerStatus,
short powerDraw,
short powerDrawMax,
short etaSeconds)
2020-05-02 15:02:52 +01:00
{
On = on;
Charge = charge;
PowerStatus = powerStatus;
PowerDraw = powerDraw;
PowerDrawMax = powerDrawMax;
EtaSeconds = etaSeconds;
2020-05-02 15:02:52 +01:00
}
}
[Serializable, NetSerializable]
public enum GravityGeneratorUiKey
{
Key
}
}
[Serializable, NetSerializable]
public enum GravityGeneratorVisuals
{
State,
Charge
}
[Serializable, NetSerializable]
public enum GravityGeneratorStatus
{
Broken,
Unpowered,
Off,
On
}
[Serializable, NetSerializable]
public enum GravityGeneratorPowerStatus : byte
{
Off,
Discharging,
Charging,
FullyCharged
}
2020-05-02 15:02:52 +01:00
}