void updateLists(BuildingFoundation newFoundation, Edge curEdge, Junction curJunction, List <BuildingFoundation> toUpdate, bool addEdges, bool addFreeCorners)
    {
        toUpdate.Add(newFoundation);
        if (addFreeCorners)
        {
            freeCorners.AddRange(newFoundation.corners);
        }
        allCorners.AddRange(newFoundation.corners);
        List <Edge> newEdges = newFoundation.getEdges();

        usedEdges.Add(newEdges [3]);
        if (addEdges)
        {
            newEdges.RemoveAt(3);
            freeEdges.AddRange(newEdges);
        }
        freeEdges.Remove(curEdge);
        usedEdges.Add(curEdge);
        curJunction.adjacentFoundations [0] = curEdge.foundation;
        curJunction.adjacentFoundations [1] = newFoundation;
        junctions.Add(curJunction);
    }