Add a setOut to the gate parent class

This commit is contained in:
daniel 2017-04-23 19:53:37 -04:00
parent 2cacfb9dc0
commit 031fea3e0a
2 changed files with 7 additions and 2 deletions

View File

@ -8,7 +8,7 @@ class Wire;
class Gate { class Gate {
public: public:
virtual Event evaluate(int) = 0; virtual Event evaluate(int) = 0;
void setOut(int time, int value);
protected: protected:
Wire *in1, *in2, *out; Wire *in1, *in2, *out;
int delay; int delay;

View File

@ -1,5 +1,10 @@
#include "gate.h" #include "gate.h"
gate::gate() Gate::Gate()
{ {
} }
void Gate::setOut(int newValue, int setTime)
{
out->setValue(newValue, setTime);
}