using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Gravity { [NetworkedComponent()] [Virtual] public class SharedGravityGeneratorComponent : Component { /// /// A map of the sprites used by the gravity generator given its status. /// [DataField("spriteMap")] [Access(typeof(SharedGravitySystem))] public Dictionary SpriteMap = new(); /// /// The sprite used by the core of the gravity generator when the gravity generator is starting up. /// [DataField("coreStartupState")] [ViewVariables(VVAccess.ReadWrite)] public string CoreStartupState = "startup"; /// /// The sprite used by the core of the gravity generator when the gravity generator is idle. /// [DataField("coreIdleState")] [ViewVariables(VVAccess.ReadWrite)] public string CoreIdleState = "idle"; /// /// The sprite used by the core of the gravity generator when the gravity generator is activating. /// [DataField("coreActivatingState")] [ViewVariables(VVAccess.ReadWrite)] public string CoreActivatingState = "activating"; /// /// The sprite used by the core of the gravity generator when the gravity generator is active. /// [DataField("coreActivatedState")] [ViewVariables(VVAccess.ReadWrite)] public string CoreActivatedState = "activated"; /// /// Sent to the server to set whether the generator should be on or off /// [Serializable, NetSerializable] public sealed class SwitchGeneratorMessage : BoundUserInterfaceMessage { public bool On; public SwitchGeneratorMessage(bool on) { On = on; } } [Serializable, NetSerializable] public sealed 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, byte charge, GravityGeneratorPowerStatus powerStatus, short powerDraw, short powerDrawMax, short etaSeconds) { On = on; Charge = charge; PowerStatus = powerStatus; PowerDraw = powerDraw; PowerDrawMax = powerDrawMax; EtaSeconds = etaSeconds; } } [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 } }