stuff-from-scratch/plugins/circuits/ElectronicCircuit.h

64 lines
679 B
C
Raw Normal View History

2022-12-11 19:50:34 +00:00
#pragma once
#include <memory>
#include <vector>
2023-01-03 07:47:49 +00:00
class CircuitElement
2022-12-11 19:50:34 +00:00
{
};
2023-01-03 07:47:49 +00:00
class Terminal : public CircuitElement
{
public:
enum class Type
{
INPUT,
OUTPUT
};
Terminal(Type type)
: mType(type)
{
}
private:
double mValue{0};
Type mType;
};
2022-12-11 19:50:34 +00:00
class Wire
{
2023-01-03 07:47:49 +00:00
public:
Wire(CircuitElement* input, CircuitElement* output)
: mInput(input),
mOutput(output)
{
2022-12-11 19:50:34 +00:00
2023-01-03 07:47:49 +00:00
}
private:
CircuitElement* mInput{nullptr};
CircuitElement* mOutput{nullptr};
2022-12-11 19:50:34 +00:00
};
class LogicGate
{
2023-01-03 07:47:49 +00:00
public:
enum class Type
{
NOT,
AND,
OR,
XOR,
2022-12-11 19:50:34 +00:00
2023-01-03 07:47:49 +00:00
};
2022-12-11 19:50:34 +00:00
};
class ElectronicCircuit
{
};