private bool IsNotBlockingEnemies(int X, int Y) { towersMap[X, Y] = true; Astar.SetGrid(towersMap); for (int y = 0; y < ySize; y++) { for (int x = 0; x < xSize; x++) { if (enemiesCount[y, x] > 0) { if (Astar.CalcPath(new Node(y, x), destination).Count == 0) { towersMap[X, Y] = false; return(false); } } } } towersMap[X, Y] = false; return(true); }
public void CalculatePath(Node from, Node to) { SetPath(new Queue <Node>(Astar.CalcPath(from, to).AsEnumerable().Reverse())); }