public static List<AStarBitch.AStarNode> Astarfct(MapGenerator.FieldInfo[] map, int hauteur_map, int largeur_map, int start, int end) { AStarBitch asb = new AStarBitch(); asb.haut = hauteur_map; asb.larg = largeur_map; List<AStarBitch.AStarNode> _ret = null; List<AStarBitch.AStarNode> _map = null; _map = asb.buildAStarMap(map, hauteur_map, largeur_map); _ret = asb.aStar(_map, hauteur_map, largeur_map, start, end); return _ret; }
private List<AStarBitch.AStarNode> getNodesAround(List<AStarBitch.AStarNode> map, AStarBitch.AStarNode node) { List<AStarBitch.AStarNode> ret = new List<AStarBitch.AStarNode>(); if (node.x > 0) ret.Add(map.Find(x => x.pos == (node.pos - 1))); if (node.x < larg - 1) ret.Add(map.Find(x => x.pos == (node.pos + 1))); if (node.y > 0) ret.Add(map.Find(x => x.pos == (node.pos - larg))); if (node.y < haut - 1) ret.Add(map.Find(x => x.pos == (node.pos + larg))); return ret; }