public static List <UEdge2i> All_ActiveEdges_List(
            this PM_Maze maze
            )
        {
            int width  = maze.Q_Width();
            int height = maze.Q_Height();

            List <UEdge2i> activeEdges = new List <UEdge2i>();

            for (int x = 0; x < width; x++)
            {
                for (int y = 0; y < height; y++)
                {
                    var newEdges = maze.Cell_ActiveEdges_Set(x, y);
                    foreach (var newEdge in newEdges)
                    {
                        if (activeEdges.Contains(newEdge) == false)
                        {
                            activeEdges.Add(newEdge);
                        }
                    }
                }
            }
            return(activeEdges);
        }
 public static HashSet <UEdge2i> Cell_ActiveEdges_Set(
     this PM_Maze maze,
     int x,
     int y)
 {
     return(maze.Cell_ActiveEdges_Set(new Vec2i(x, y)));
 }
        public static void OP_DeleteCell(this PM_Maze maze, Vec2i cell)
        {
            HashSet <UEdge2i> cellActiveEdges = maze.Cell_ActiveEdges_Set(cell);

            foreach (UEdge2i edge in cellActiveEdges)
            {
                maze.OP_RemoveEdge(edge);
            }
        }
        public static HashSet <UEdge2i> All_ActiveEdges_Set(
            this PM_Maze maze
            )
        {
            int width  = maze.Q_Width();
            int height = maze.Q_Height();

            HashSet <UEdge2i> activeEdges = new HashSet <UEdge2i>();

            for (int x = 0; x < width; x++)
            {
                for (int y = 0; y < height; y++)
                {
                    activeEdges.UnionWith(maze.Cell_ActiveEdges_Set(x, y));
                }
            }
            return(activeEdges);
        }
 public static void HOP_KeepArea(this PM_Maze maze, Rect2i area)
 {
     if (maze.Q_Is_Area_InBounds(area) == false)
     {
         return;
     }
     for (int x = 0; x < maze.Q_Width(); x++)
     {
         for (int y = 0; y < maze.Q_Height(); y++)
         {
             Vec2i cell = new Vec2i(x, y);
             if (area.Contains(cell) == false)
             {
                 HashSet <UEdge2i> cellEdges = maze.Cell_ActiveEdges_Set(cell);
                 foreach (var edge in cellEdges)
                 {
                     maze.OP_RemoveEdge(edge);
                 }
             }
         }
     }
 }