63 lines
679 B
C++
63 lines
679 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
class CircuitElement
|
|
{
|
|
|
|
};
|
|
|
|
class Terminal : public CircuitElement
|
|
{
|
|
public:
|
|
enum class Type
|
|
{
|
|
INPUT,
|
|
OUTPUT
|
|
};
|
|
|
|
Terminal(Type type)
|
|
: mType(type)
|
|
{
|
|
|
|
}
|
|
|
|
private:
|
|
double mValue{0};
|
|
Type mType;
|
|
};
|
|
|
|
class Wire
|
|
{
|
|
public:
|
|
Wire(CircuitElement* input, CircuitElement* output)
|
|
: mInput(input),
|
|
mOutput(output)
|
|
{
|
|
|
|
}
|
|
|
|
private:
|
|
CircuitElement* mInput{nullptr};
|
|
CircuitElement* mOutput{nullptr};
|
|
};
|
|
|
|
class LogicGate
|
|
{
|
|
public:
|
|
enum class Type
|
|
{
|
|
NOT,
|
|
AND,
|
|
OR,
|
|
XOR,
|
|
|
|
|
|
};
|
|
};
|
|
|
|
class ElectronicCircuit
|
|
{
|
|
|
|
};
|