-/*
- * c_link.h
- * c-link-lib
- *
- * Created by Daniel Axtens on 19/04/10.
- * Licensed under an MIT-style license: see the LICENSE file for details.
- *
- */
-
-#include <stdio.h>
-
-#define MAXCOMMANDLEN 15
-#define MAXFOENAMELEN 50
-#define MAXITEMLEN 10
-#define MAXBOOLLEN 6
-
-/********** Type definitions **********/
-
-/* The type of item used in an attack or defence */
-typedef enum {rock, paper, scissors} ITEMTYPE;
-
-/* A result of a battle */
-typedef enum {win, lose, tie} RESULTTYPE;
-
-
-/* An attack, consisting of the real attack and the attack promised */
-typedef struct {
- ITEMTYPE realAttack;
- ITEMTYPE promisedAttack;
-} ATTACKTYPE;
-
-
-/********** Utility Function definitions **********/
-/* These are implemented in c-link.c, and automagically linked in */
-
-/* prints a debug message. Same arguments as printf().
- (you can't use printf because it is used to talk between
- the agent and supervisor)
- */
-
-#define debugmsg(x...) fprintf(stderr, x)
-
-/* A (hopefully) unique identifier for this particular instance of your agent,
- to help with debugging */
-int me;
-
-
-/* Returns a random item */
-
-ITEMTYPE RandomAttack();
-
-/* A useful translation table
- eg debugmsg( "I use %s.\n", ITEMNAMES[rock] ); */
-
-extern char ITEMNAMES[3][MAXITEMLEN];
-
-/* Another useful table - what's the result of the
- first item vs the second item? */
-extern RESULTTYPE RESULTOF[3][3];
-
-/********** Bot Function definitions **********/
-/* You need to provide implementations for these to create a bot */
-
-/* Defend( foeName : string - the name of your foe;
- foePromisedAttack : ITEMTYPE - the item your foe promised to use
- ) : ITEMTYPE - the item you wish to use to defend;
-
- Called when your agent needs to defend itself.
-
- */
-ITEMTYPE Defend( char * foeName, ITEMTYPE foePromisedAttack );
-
-
-/* Attack( foeName : string - the name of your foe
- ) : ATTACKTYPE - the real and promised attack you wish to use
-
- Called when your agent needs to attack another agent.
-
- */
-ATTACKTYPE Attack( char * foeName );
-
-
-/* Results( foeName : string - the name of your foe;
- isInstigatedByYou : 0=you defended/1=you attacked;
- yourItem : ITEMTYPE - the item you used;
- theirItem : ITEMTYPE - the item they used;
- promisedItem : ITEMTYPE - the item that was promised
- );
-
- Called after your agent battles another agent, to tell you how the battle goes.
-
- */
-void Results( char * foeName, int isInstigatedByYou, ITEMTYPE yourItem,
- ITEMTYPE theirItem, ITEMTYPE promisedItem);
-
-/* Cleanup();
-
- Called when your agent is no longer needed, either due to the round ending
- or due to your agent being eliminated.
-
- */
-void Cleanup();
\ No newline at end of file
+/*\r
+ * c_link.h\r
+ * c-link-lib\r
+ *\r
+ * Created by Daniel Axtens on 19/04/10.\r
+ * Licensed under an MIT-style license: see the LICENSE file for details.\r
+ *\r
+ */\r
+\r
+#include <stdio.h>\r
+\r
+#define MAXCOMMANDLEN 15\r
+#define MAXFOENAMELEN 50\r
+#define MAXITEMLEN 10\r
+#define MAXRESULTLEN 10\r
+#define MAXBOOLLEN 6\r
+#define UUIDLEN 37 // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx (8-4-4-4-12) + 1 null\r
+\r
+/********** Type definitions **********/\r
+\r
+/* The type of item used in an attack or defence */\r
+typedef enum {rock, paper, scissors} ITEMTYPE;\r
+\r
+/* A result of a battle, in terms of who won */\r
+typedef enum {attacker, defender, tie} RESULTTYPE;\r
+\r
+\r
+/* An attack, consisting of the real attack and the attack promised */\r
+typedef struct {\r
+ ITEMTYPE realAttack;\r
+ ITEMTYPE promisedAttack;\r
+} ATTACKTYPE;\r
+\r
+\r
+/********** Utility Function definitions **********/\r
+/* These are implemented in c-link.c, and automagically linked in */\r
+\r
+/* prints a debug message. Same arguments as printf().\r
+ (you can't use printf because it is used to talk between\r
+ the agent and supervisor) \r
+ */\r
+\r
+#define debugmsg(x...) fprintf(stderr, x)\r
+\r
+/* A (hopefully) unique identifier for this particular instance of your agent,\r
+ to help with debugging */\r
+int me;\r
+\r
+\r
+/* Returns a random item */\r
+\r
+ITEMTYPE RandomAttack();\r
+\r
+/* A useful translation table\r
+ eg debugmsg( "I use %s.\n", ITEMNAMES[rock] ); */\r
+\r
+extern char ITEMNAMES[3][MAXITEMLEN];\r
+\r
+/* Another useful table - who's the victor given an \r
+ attacker with first item vs defender with the second item? */\r
+extern RESULTTYPE RESULTOF[3][3];\r
+\r
+/********** Bot Function definitions **********/\r
+/* You need to provide implementations for these to create a bot */\r
+\r
+/* Initialise( yourName : string - name of this instance (you)\r
+ ) : void * - A data pointer to represent this instance\r
+ \r
+ Called to create a new instance of this agent\r
+\r
+ */\r
+void *Initialise( char * yourName );\r
+\r
+/* Defend( this : pointer - value returned from Initialise();\r
+ foeName : string - the name of your foe;\r
+ foePromisedAttack : ITEMTYPE - the item your foe promised to use\r
+ ) : ITEMTYPE - the item you wish to use to defend;\r
+ \r
+ Called when your agent needs to defend itself.\r
+ \r
+ */\r
+ITEMTYPE Defend( void * this, char * foeName, ITEMTYPE foePromisedAttack );\r
+\r
+\r
+/* Attack( this: pointer - value returned from Initialise();\r
+ foeName : string - the name of your foe\r
+ ) : ATTACKTYPE - the real and promised attack you wish to use\r
+\r
+ Called when your agent needs to attack another agent.\r
+ \r
+ */\r
+ATTACKTYPE Attack( void * this, char * foeName );\r
+\r
+\r
+/* Results( this : pointer - value returned from Initialise();\r
+ foeName : string - the name of your foe;\r
+ isInstigatedByYou : 0=you defended/1=you attacked;\r
+ winner : RESULTTYPE - who won\r
+ attItem : ITEMTYPE - the item used to attack;\r
+ defItem : ITEMTYPE - the item used to defend;\r
+ bluffItem : ITEMTYPE - the item that was promised\r
+ pointDelta : integer - how your points were affected.\r
+ );\r
+\r
+ Called after your agent battles another agent, to tell you how the battle goes.\r
+ \r
+ */\r
+void Results( void * this, char * foeName, int isInstigatedByYou, RESULTTYPE winner,\r
+ ITEMTYPE attItem, ITEMTYPE defItem, ITEMTYPE bluffItem,\r
+ int pointDelta );\r
+\r
+/* Cleanup( this: pointer - value returned from Initialise()\r
+ );\r
+\r
+ Called when your agent is no longer needed, either due to the round ending\r
+ or due to your agent being eliminated.\r
+\r
+ */\r
+void Cleanup( void * this );\r