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/Splitter.cs
2022-09-04 12:45:01 +02:00

27 lines
752 B
C#

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