X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=agents%2Framen%2Fsrc%2Finterface.h;fp=agents%2Framen%2Fsrc%2Finterface.h;h=cb7e949595f85cbe149e0a58a6afcb3b9a71e984;hp=0000000000000000000000000000000000000000;hb=52489d9b9b2d7633f9b7caaed0ed1ea40972032b;hpb=add28d0a7f265f5fcfdd67a4c1e590b19f76272e diff --git a/agents/ramen/src/interface.h b/agents/ramen/src/interface.h new file mode 100644 index 0000000..cb7e949 --- /dev/null +++ b/agents/ramen/src/interface.h @@ -0,0 +1,70 @@ +/* + * UCC 2012 Programming Competition Entry + * - "Ramen" + * + * By John Hodge [TPG] + */ +#ifndef _COMMON_H_ +#define _COMMON_H_ + +#if ENABLE_DEBUG +# define DEBUG(s, a...) fprintf(stderr, "DEBUG: "s"\n" ,## a) +#else +# define DEBUG(...) do{}while(0) +#endif +#define ASSERT(val) do{if(!(val)){fprintf(stderr, "ASSERTION FAILED - " #val " at %s:%i\n", __FILE__, __LINE__);exit(-1);} }while(0) + + +#define true 1 +#define false 0 +typedef char BOOL; + +typedef struct sMove tMove; + +enum eDirections +{ + DIR_INVAL, + DIR_LEFT, + DIR_RIGHT, + DIR_UP, + DIR_DOWN +}; + +enum eColours +{ + COLOUR_RED, + COLOUR_BLUE +}; + +enum eResult +{ + RESULT_INVAL, + RESULT_ILLEGAL, + RESULT_OK, + RESULT_KILL, + RESULT_DIES, + RESULT_BOTHDIE, + RESULT_VICTORY +}; + +struct sMove +{ + char x, y; + enum eDirections dir; // eDirections + char dist; + + enum eResult result; + char attacker; + char defender; +}; + +extern int giBoardWidth; +extern int giBoardHeight; +extern char *gaBoardState; + +extern void AI_Initialise(enum eColours Colour, const char *Opponent); +extern void AI_HandleMove(int bMyMove, const tMove *Move); +extern void AI_DoMove(tMove *MyMove); + +#endif +