public void Add(InputPin pin) { if (inputPins.Contains(pin)) { return; } inputPins.Add(pin); AddInternal((Pin)pin); ChangeJunctionStateByPin(pin); }
private void ChangeJunctionStateByPin(InputPin pin) { var allHigh = AllHigh(); if (allHigh) { pin.State = true; } foreach (var p in inputPins) { if (p == pin) { continue; } p.State = allHigh || pin.State; } }