Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ProjectBackup/C#/DigiSim/Logic/Gates/NotGate.cs
2022-09-04 12:45:01 +02:00

25 lines
687 B
C#

using System.Windows.Controls;
using System.Windows.Shapes;
namespace DigiSim.Logic.Gates {
public class NotGate : Gate {
public NotGate(double x, double y) : base(x, y, 25, 25) { }
protected override void InternalSetup(Canvas canvas) {
Shape = new Rectangle();
SetInputs(1);
SetOutputs(1);
CreateConnections();
Text = "!1";
Instantiate();
}
public override void Update(Gate source) {
ConnectedOutputs[0].IsPowered = !ConnectedInputs[0].IsPowered;
UpdateShapes();
UpdateConnectedGates(source);
}
}
}