Switch gate watchers to notify on input mask changes, add DivideByNCounter

This commit is contained in:
Stone_Red
2026-03-27 03:09:52 +01:00
parent 5b3cdc186f
commit 1deb90a1f0
6 changed files with 161 additions and 21 deletions
@@ -114,11 +114,11 @@ public interface ICircuitSimulator
bool TryRunUntilStable(int maxSteps, out int steps);
/// <summary>
/// Subscribes to output changes on a specific gate.
/// The callback is invoked whenever the gate's output value changes.
/// Subscribes to input mask changes on a specific gate.
/// The callback is invoked whenever the gate's input mask changes.
/// </summary>
/// <param name="gateId">The gate ID to watch.</param>
/// <param name="callback">Action to invoke on change. Parameters are (gateId, newOutputMask).</param>
/// <param name="callback">Action to invoke on change. Parameters are (gateId, newInputMask).</param>
/// <returns>An <see cref="IDisposable"/> that unsubscribes the watcher when disposed.</returns>
/// <exception cref="ArgumentNullException">Thrown when callback is null.</exception>
/// <exception cref="ArgumentOutOfRangeException">Thrown when gateId is invalid.</exception>