From 031fea3e0ac04d55f59a96e25c33f8948a708eee Mon Sep 17 00:00:00 2001 From: daniel Date: Sun, 23 Apr 2017 19:53:37 -0400 Subject: [PATCH] Add a setOut to the gate parent class --- src/Gate.h | 2 +- src/gate.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Gate.h b/src/Gate.h index 5607793..b9b19e6 100644 --- a/src/Gate.h +++ b/src/Gate.h @@ -8,7 +8,7 @@ class Wire; class Gate { public: virtual Event evaluate(int) = 0; - + void setOut(int time, int value); protected: Wire *in1, *in2, *out; int delay; diff --git a/src/gate.cpp b/src/gate.cpp index 613bbe0..5499e92 100644 --- a/src/gate.cpp +++ b/src/gate.cpp @@ -1,5 +1,10 @@ #include "gate.h" -gate::gate() +Gate::Gate() { } + +void Gate::setOut(int newValue, int setTime) +{ + out->setValue(newValue, setTime); +}