package leigh.mecha.nodegraph.javafx;

import leigh.mecha.nodegraph.NodeAttribute;

/**
 * User-data meant to be associated with a socket circle on a node object.
 * <p>
 * This class exists since it is insufficient to store the {@link NodeAttribute} configuration, since that does not
 * indicate whether the socket is the input or the output side.
 *
 * @author Alex Leigh
 * @since mk14 mod19 (CRYSTAL)
 */
public class SocketUserData {
    private final NodeAttribute attrCfg;
    private final boolean isOutput;

    public SocketUserData(NodeAttribute attrCfg, boolean isOutput) {
        this.attrCfg = attrCfg;
        this.isOutput = isOutput;
    }

    public NodeAttribute getAttrCfg() {
        return attrCfg;
    }

    public boolean isOutput() {
        return isOutput;
    }

    @Override
    public String toString() {
        return "SocketUserData{" +
                "name='" + attrCfg + '\'' +
                ", isOutput=" + isOutput +
                '}';
    }
}
