WirePorts
namespace Griff.Modules.Contraptions;
public static class WirePortsThe inputs and outputs Wires connect, and reading an output’s value.
Methods
Section titled “Methods”public static Entity? Find(Entity from, string? name)The entity a From, To or To name means for from: the nearest other entity with that name, or null.
Inputs
Section titled “Inputs”public static IReadOnlyList<string> Inputs(Entity entity)The inputs entity has: its parts’ own, then “Power” and “Show”, which everything has (held while the signal is on), then its components’ actions (see ActionAttribute), each done once as the signal comes on, e.g. “Spawn” or “Damage” (with the signal as the amount).
Outputs
Section titled “Outputs”public static IReadOnlyList<string> Outputs(Entity entity)The outputs entity has, e.g. “On” for a button, “Out” for a gate, “Score” for a match board: its components’ outputs that give a number or true or false (see OutputAttribute), a script’s too. One read by a name is written with an example, e.g. “Amount:Gold”.
public static float Read(Entity entity, string? port)What entity’s output port is giving right now (true is 1), e.g. “On”, “Score” or “Amount:Gold”; 0 if it has no such output.