lots of work in opponent avoidance and strats
[aversive.git] / projects / microb2010 / mainboard / strat_avoid.h
index 4afe032..56de996 100644 (file)
@@ -27,7 +27,7 @@
 struct wp_coord {
        uint8_t i:4;
        uint8_t j:3;
-       uint8_t end:1;
+       uint8_t reserved:1;
 };
 
 struct wp_line {
@@ -39,9 +39,27 @@ int8_t browse_circuits(uint8_t i, uint8_t j,
                       const struct wp_coord **selected_circuit,
                       int8_t *selected_face);
 
+/* try to unblock in any situation */
+uint8_t strat_unblock(void);
+
 /* harvest on the best circuit */
 uint8_t strat_harvest_circuit(void);
 
+/* get the neighbour of the point at specified dir, return -1 if
+ * there is no neighbor */
+int8_t wp_get_neigh(uint8_t i, uint8_t j, uint8_t *ni, uint8_t *nj,
+                uint8_t dir);
+
+/* count the number of non-black corns which are neighbors of
+ * specified cob */
+uint8_t corn_count_neigh(uint8_t i, uint8_t j);
+
+/* return true if a waypoint belongs to a line */
+uint8_t wp_belongs_to_line(uint8_t i, uint8_t j, uint8_t linenum, uint8_t dir);
+
+uint8_t is_60deg(uint8_t dir1, uint8_t dir2);
+uint8_t is_120deg(uint8_t dir1, uint8_t dir2);
+
 void test_strat_avoid(void);
 
 #endif