#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;
    TerminalType mType;
    Wire* mConnection{ nullptr };
};
using TerminalPtr = std::unique_ptr<Terminal>;
