Show / Hide Table of Contents

Interface IWireAction

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.

Namespace: Content.Server.Wires
Assembly: Content.Server.dll
Syntax
public interface IWireAction

Properties

| Improve this Doc View Source

StatusKey

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.

Declaration
object? StatusKey { get; }
Property Value
Type Description
System.Nullable<System.Object>

Methods

| Improve this Doc View Source

AddWire(Wire, Int32)

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.

Declaration
bool AddWire(Wire wire, int count)
Parameters
Type Name Description
Wire wire

The wire in the entity's WiresComponent.

System.Int32 count

The current count of this instance of the wire type.

Returns
Type Description
System.Boolean
| Improve this Doc View Source

Cut(EntityUid, Wire)

What happens when this wire is cut. If this returns false, the wire will not actually get cut.

Declaration
bool Cut(EntityUid user, Wire wire)
Parameters
Type Name Description
EntityUid user

The user attempting to interact with the wire.

Wire wire

The wire being interacted with.

Returns
Type Description
System.Boolean

true if successful, false otherwise.

| Improve this Doc View Source

GetStatusLightData(Wire)

Used for when WiresSystem requires the status light data for display on the client.

Declaration
StatusLightData? GetStatusLightData(Wire wire)
Parameters
Type Name Description
Wire wire
Returns
Type Description
System.Nullable<StatusLightData>

StatusLightData to display light data, null to have no status light.

| Improve this Doc View Source

Initialize()

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!)

Declaration
void Initialize()
| Improve this Doc View Source

Mend(EntityUid, Wire)

What happens when this wire is mended. If this returns false, the wire will not actually get cut.

Declaration
bool Mend(EntityUid user, Wire wire)
Parameters
Type Name Description
EntityUid user

The user attempting to interact with the wire.

Wire wire

The wire being interacted with.

Returns
Type Description
System.Boolean

true if successful, false otherwise.

| Improve this Doc View Source

Pulse(EntityUid, Wire)

This method gets called when the wire is pulsed..

Declaration
void Pulse(EntityUid user, Wire wire)
Parameters
Type Name Description
EntityUid user

The user attempting to interact with the wire.

Wire wire

The wire being interacted with.

| Improve this Doc View Source

Update(Wire)

Used when a wire's state on an entity needs to be updated. Mostly for things related to entity events, e.g., power.

Declaration
void Update(Wire wire)
Parameters
Type Name Description
Wire wire
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾