using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Power.Generator; /// /// Enables a device to switch between HV, MV and LV connectors. /// For generators this means changing output wires. /// /// /// Must have CableDeviceNodes for each output in . /// If its a generator PowerSupplierComponent is also required. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [Access(typeof(SharedPowerSwitchableSystem))] public sealed partial class PowerSwitchableComponent : Component { /// /// Index into that the device is currently using. /// [DataField, AutoNetworkedField] public int ActiveIndex; /// /// Sound that plays when the cable is switched. /// [DataField] public SoundSpecifier? SwitchSound = new SoundPathSpecifier("/Audio/Machines/button.ogg"); /// /// Locale id for text shown when examined. /// It is given "voltage" as a colored voltage string. /// [DataField(required: true)] public string ExamineText = string.Empty; /// /// Locale id for the popup shown when switching voltages. /// It is given "voltage" as a colored voltage string. /// [DataField(required: true)] public string SwitchText = string.Empty; /// /// Cable voltages and their nodes which can be cycled between. /// Each node name must match a cable node in its NodeContainer. /// [DataField(required: true)] public List Cables = new(); } /// /// Cable voltage and node name for cycling. /// [DataDefinition] public sealed partial class PowerSwitchableCable { /// /// Voltage that the cable uses. /// [DataField(required: true)] public SwitchableVoltage Voltage; /// /// Name of the node for the cable. /// Must be a CableDeviceNode /// [DataField(required: true)] public string Node = string.Empty; } /// /// Cable voltage to cycle between. /// [Serializable, NetSerializable] public enum SwitchableVoltage : byte { HV, MV, LV }