static G RandomAlgorithm <G, T>(Grid grid, Algorithm algorithm) where G : Grid where T : Cell { switch (algorithm) { case Algorithm.AldousBroder: return(AldousBroder.CreateMaze <G, T>(grid as G)); case Algorithm.BinaryTree: return(BinaryTree.CreateMaze(grid) as G); case Algorithm.HuntAndKill: return(HuntAndKill.CreateMaze <G, T>(grid as G)); case Algorithm.RecursiveBacktracker: return(RecursiveBacktracker.CreateMaze <G, T>(grid as G)); case Algorithm.Sidewinder: return(Sidewinder.CreateMaze(grid) as G); case Algorithm.Wilsons: return(Wilsons.CreateMaze <G, T>(grid as G)); case Algorithm.Kruskals: return(Kruskals.CreateMaze(grid) as G); case Algorithm.Prims: return(Prims.CreateMaze <G, T>(grid as G)); case Algorithm.TruePrims: return(TruePrims.CreateMaze <G, T>(grid as G)); case Algorithm.GrowingTree: return(GrowingTree.CreateMaze <G, T>(grid as G)); case Algorithm.RecursiveDivision: return(RecursiveDivision.CreateMaze(grid) as G); case Algorithm.Ellers: return(Ellers.CreateMaze(grid) as G); case Algorithm.Houstons: return(Houstons.CreateMaze <G, T>(grid as G)); } return(null); }