#include "Wire.h"
#include "Piece.h"

Wire::Wire(Connection* connection, Circuit* circuit){

    //Konstruktor je prepis zobrazenia omega
    this->connection=connection;
    Piece* pieceInput = circuit->getPiece(connection->input);
    Piece* pieceOutput = circuit->getPiece(connection->output);

    xKeyPoints[0] = pieceInput->x + pieceInput->width;
    xKeyPoints[3] = pieceOutput->x;
    xKeyPoints[1] = xKeyPoints[2] = (xKeyPoints[0] + xKeyPoints[3]) / 2;

    yKeyPoints[0] = pieceInput->outputY->at(connection->outputIndex);
    yKeyPoints[3] = pieceOutput->inputY->at(connection->inputIndex);
    yKeyPoints[1] = yKeyPoints[2] = (yKeyPoints[0] + yKeyPoints[3]) / 2;
}

Wire::~Wire(void){
}
