wiremod / wirebox

Wire for S&Box. Early WIP.
MIT License
37 stars 8 forks source link

Wirelib: Support 'any' meta-type #34

Closed Nebual closed 12 months ago

Nebual commented 1 year ago

Several Selection and Memory Gates could benefit from a generic/any/object type of input, such as the Latch (Inputs: Write, Value) which updates its output to be = the input Value, whenever Write is set to true. This could allow storing a Vector3, string, float, or Entity inside a single type of Latch gate, rather than needing many similar variations of gates for each storage type.

Since WirePort's internally store values as object anyways, and we then run them all through the type conversion helpers, this may actually be pretty straightforward to support/expose.

Though we may want to ponder it a bit and think up other use cases before we commit to adding the user-visible-complexity of an additional type to wire. If we don't have an 'any' type, we could instead just have 4 Latches, or have the Latch update its Input/Output when you first try to wire it, or have it in some way be cyclable (eg. on E)