12 lines
311 B
C++
12 lines
311 B
C++
#include "andGate.h"
|
|
|
|
using namespace std;
|
|
|
|
andGate::andGate(wire* wire1 = nullptr, wire* wire2 = nullptr,
|
|
wire* wire3 = nullptr) : in1(wire1), in2(wire2), out(wire3) {}
|
|
|
|
int andGate::evaluate(int evTime) {
|
|
int bool1 = in1 -> getValue();
|
|
return ( in1 -> getValue(evTime) ) && ( in2 -> getValue(evTime) );
|
|
}
|