Initial circuits plugin work.

This commit is contained in:
jmsgrogan 2023-01-20 16:47:39 +00:00
parent b5f21900eb
commit f8a2ce3c59
50 changed files with 1451 additions and 97 deletions

View file

@ -0,0 +1,35 @@
#pragma once
#include "CircuitElement.h"
#include <string>
class Wire;
class Terminal : public CircuitElement
{
public:
enum class TerminalType
{
INPUT,
OUTPUT
};
Terminal(TerminalType type, const std::string& label = {});
Wire* getConnection() const;
Type getType() const override
{
return mType == TerminalType::INPUT ? Type::INPUT_TERMINAL : Type::OUTPUT_TERMINAL;
}
void setConnection(Wire* connection);
private:
std::string mLabel;
bool mValue{ false };
TerminalType mType;
Wire* mConnection{ nullptr };
};
using TerminalPtr = std::unique_ptr<Terminal>;