+/*
+ * Pathfinding
+ */
+
+struct HL_astar_hex {
+ int hex;
+ double f, g, h;
+ struct HL_astar_hex *parent;
+ int open;
+ struct HL_astar_hex *next;
+ struct HL_astar_hex *prev;
+};
+
+struct HL_astar {
+ int start, goal;
+ int pathlen;
+ double (*metric)(int,int);
+ double (*heuristic)(int,int);
+ int (*neighbor)(int,int);
+ int nodes, allocated;
+ struct HL_astar_hex *sets;
+ struct HL_astar_hex *open;
+ struct HL_astar_hex *closed;
+ struct HL_astar_hex *from, *to;
+ int known, index;
+ int error, malloced;
+};
+
+int HL_findpath(struct HL_astar *s, int loops);
+void HL_astar_free(struct HL_astar *s);
+struct HL_astar *HL_astar_clear(struct HL_astar *s);
+struct HL_astar *HL_astar_init(struct HL_astar *s);
+