Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integer Logic Signals #283

Closed
DanielStebbins opened this issue Jul 8, 2024 · 0 comments · Fixed by #288
Closed

Integer Logic Signals #283

DanielStebbins opened this issue Jul 8, 2024 · 0 comments · Fixed by #288
Assignees
Labels
enhancement New feature or request

Comments

@DanielStebbins
Copy link
Collaborator

Currently, the logic system uses Boolean values: on and off are the only available states of a logic group.

To allow for easier logistics, the game should allow for numeric signals, which can later represent, for example, item counts, energy percentage, a rate of fluid production, etc.

Requirements:

  • Logic producers should output a signed integer (i32?) instead of a boolean, which should be tracked in the LogicGroup's HashMap of producers. The LogicGroup's "on()" function should then add the signals of its producers instead of taking the logical OR of them.
  • Blocks that expect Boolean logic inputs/outputs (logic gates, logic indicators) should conform to the standard that a signal of 0 is "off" and any other signal is "on".
  • New comparison and arithmetic blocks become possible with this change. This issue should add at least an Adder, Subtractor, Invertor (single-input block that flips the sign of the input signal, not to be confused with a NOT gate), and a comparator (two-input block which outputs "on" if a specific one of its inputs is higher than the other).
  • The Logic On block should now output some constant, which can be set and checked by the player (probably requires a GUI).
  • The Logic Indicator block should provide a way to view the exact signal (probably requires a GUI, could be the same as the Logic On block but immutable).
@DanielStebbins DanielStebbins added the enhancement New feature or request label Jul 8, 2024
@DanielStebbins DanielStebbins self-assigned this Jul 8, 2024
@DanielStebbins DanielStebbins linked a pull request Jul 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant