private BlockLink(Workspace workspace, Block block1, Block block2, BlockConnector socket1, BlockConnector socket2) {
        this.workspace = workspace;
        boolean isPlug1 = (block1.hasPlug() && block1.getPlug() == socket1)
                || (block1.hasBeforeConnector() && block1.getBeforeConnector() == socket1);
        boolean isPlug2 = (block2.hasPlug() && block2.getPlug() == socket2)
                || (block2.hasBeforeConnector() && block2.getBeforeConnector() == socket2);
        if (!(isPlug1 ^ isPlug2)) {
            // bad news... there should be only one plug
            assert (false);
        } else if (isPlug1) {
            plug = socket1;
            socket = socket2;
            plugBlockID = block1.getBlockID();
            socketBlockID = block2.getBlockID();
        } else {
            plug = socket2;
            socket = socket1;
            plugBlockID = block2.getBlockID();
            socketBlockID = block1.getBlockID();
        }
        lastPlugID = plugBlockID;
        lastSocketID = socketBlockID;
        lastPlug = plug;
        lastSocket = socket;
        lastPlugBlockID = Block.NULL;
    }