allow defining pins after inserting it to other gate
This commit is contained in:
parent
2838795f32
commit
73fa6e12fe
@ -1,5 +1,6 @@
|
||||
public class DigitalInput {
|
||||
private boolean value = false;
|
||||
private LogicGate gt = null;
|
||||
|
||||
public DigitalInput(final boolean value) {
|
||||
setValue(value);
|
||||
@ -24,7 +25,11 @@ public class DigitalInput {
|
||||
}
|
||||
|
||||
public boolean getValue() {
|
||||
return value;
|
||||
if (gt != null) {
|
||||
return gt.getOutput(); // validate gate here
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
public void setValue(boolean value) {
|
||||
@ -32,7 +37,7 @@ public class DigitalInput {
|
||||
}
|
||||
|
||||
public void setValue(LogicGate gate) {
|
||||
this.value = gate.getOutput(); // todo validation stuff
|
||||
this.gt = gate;
|
||||
}
|
||||
|
||||
public void setValue(int value) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user