public MoveNode[] expandNodes(Grid board, MoveNode last, int ply) { List<MoveNode> nodes = new List<MoveNode>(); List<Group> moves = board.calculateGroups(); foreach(Group move in moves) { Grid b = board.copy(); if (b.checkMove(move.X, move.Y)) { b.removeGroup(move.X, move.Y); b.compressGrid(); nodes.Add(new MoveNode(move, rankGrid(b), ply, b, last)); } } return nodes.ToArray(); }
public MoveNode[] expandNodes(Grid board, MoveNode last, int ply) { List <MoveNode> nodes = new List <MoveNode>(); List <Group> moves = board.calculateGroups(); foreach (Group move in moves) { Grid b = board.copy(); if (b.checkMove(move.X, move.Y)) { b.removeGroup(move.X, move.Y); b.compressGrid(); nodes.Add(new MoveNode(move, rankGrid(b), ply, b, last)); } } return(nodes.ToArray()); }