using Content.Shared.Wires; namespace Content.Server.Wires; /// /// An interface used by WiresSystem to allow compositional wiresets. /// This is expected to be flyweighted, do not store per-entity state /// within an object/class that implements IWireAction. /// public interface IWireAction { /// /// This is to link the wire's status with /// its corresponding UI key. If this is null, /// GetStatusLightData MUST also return null, /// otherwise nothing happens. /// public object? StatusKey { get; } /// /// Called when the wire in the layout /// is created for the first time. Ensures /// that the referenced action has all /// the correct system references (plus /// other information if needed, /// but wire actions should NOT be stateful!) /// public void Initialize(); /// /// Called when a wire is finally processed /// by WiresSystem upon wire layout /// creation. Use this to set specific details /// about the state of the entity in question. /// /// If this returns false, this will convert /// the given wire into a 'dummy' wire instead. /// /// The wire in the entity's WiresComponent. /// The current count of this instance of the wire type. public bool AddWire(Wire wire, int count); /// /// What happens when this wire is cut. If this returns false, the wire will not actually get cut. /// /// The user attempting to interact with the wire. /// The wire being interacted with. /// true if successful, false otherwise. public bool Cut(EntityUid user, Wire wire); /// /// What happens when this wire is mended. If this returns false, the wire will not actually get cut. /// /// The user attempting to interact with the wire. /// The wire being interacted with. /// true if successful, false otherwise. public bool Mend(EntityUid user, Wire wire); /// /// This method gets called when the wire is pulsed.. /// /// The user attempting to interact with the wire. /// The wire being interacted with. public void Pulse(EntityUid user, Wire wire); /// /// Used when a wire's state on an entity needs to be updated. /// Mostly for things related to entity events, e.g., power. /// public void Update(Wire wire); /// /// Used for when WiresSystem requires the status light data /// for display on the client. /// /// StatusLightData to display light data, null to have no status light. public StatusLightData? GetStatusLightData(Wire wire); }