circuit strat, first version
[aversive.git] / projects / microb2010 / mainboard / strat_avoid.h
index 0978fd7..4afe032 100644 (file)
@@ -1,6 +1,6 @@
-/*  
- *  Copyright Droids Corporation, Microb Technology (2009)
- * 
+/*
+ *  Copyright Droids, Microb Technology (2010)
+ *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation; either version 2 of the License, or
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- *  Revision : $Id: strat_avoid.h,v 1.5 2009-11-08 17:24:33 zer0 Exp $
+ *  Revision : $Id: strat.c,v 1.6 2009-11-08 17:24:33 zer0 Exp $
  *
+ *  Olivier MATZ <zer0@droids-corp.org>
  */
 
-void set_opponent_poly(poly_t *pol, int16_t w, int16_t l);
-int8_t goto_and_avoid(int16_t x, int16_t y, uint8_t flags_intermediate,
-                     uint8_t flags_final);
-int8_t goto_and_avoid_backward(int16_t x, int16_t y,
-                              uint8_t flags_intermediate,
-                              uint8_t flags_final);
-int8_t goto_and_avoid_forward(int16_t x, int16_t y,
-                             uint8_t flags_intermediate,
-                             uint8_t flags_final);
+#ifndef _STRAT_AVOID_H_
+#define _STRAT_AVOID_H_
+#define MAX_CIRCUIT_WPLINE 15
+
+struct wp_coord {
+       uint8_t i:4;
+       uint8_t j:3;
+       uint8_t end:1;
+};
+
+struct wp_line {
+       uint8_t line_num:4;
+       uint8_t dir:4;
+};
+
+int8_t browse_circuits(uint8_t i, uint8_t j,
+                      const struct wp_coord **selected_circuit,
+                      int8_t *selected_face);
+
+/* harvest on the best circuit */
+uint8_t strat_harvest_circuit(void);
+
+void test_strat_avoid(void);
+
+#endif