X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Flink%2FC%2Fc_link.h;h=c3bd87cf7e5851534ac6b9d53dccaa6623cbe566;hb=edf8e5b569e75692d61a44f2c3241fb6410e4fbd;hp=44922a3f466f67f28eb00c934ba5e83a84a385ff;hpb=35ff18a5beda685e59ca898026570d67b7ead333;p=progcomp10.git diff --git a/src/link/C/c_link.h b/src/link/C/c_link.h index 44922a3..c3bd87c 100644 --- a/src/link/C/c_link.h +++ b/src/link/C/c_link.h @@ -12,6 +12,7 @@ #define MAXCOMMANDLEN 15 #define MAXFOENAMELEN 50 #define MAXITEMLEN 10 +#define MAXRESULTLEN 10 #define MAXBOOLLEN 6 /********** Type definitions **********/ @@ -19,8 +20,8 @@ /* 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; +/* A result of a battle, in terms of who won */ +typedef enum {attacker, defender, tie} RESULTTYPE; /* An attack, consisting of the real attack and the attack promised */ @@ -54,8 +55,8 @@ ITEMTYPE RandomAttack(); extern char ITEMNAMES[3][MAXITEMLEN]; -/* Another useful table - what's the result of the - first item vs the second item? */ +/* Another useful table - who's the victor given an + attacker with first item vs defender with the second item? */ extern RESULTTYPE RESULTOF[3][3]; /********** Bot Function definitions **********/ @@ -82,16 +83,19 @@ 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 + winner : RESULTTYPE - who won + attItem : ITEMTYPE - the item used to attack; + defItem : ITEMTYPE - the item used to defend; + bluffItem : ITEMTYPE - the item that was promised + pointDelta : integer - how your points were affected. ); 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); +void Results( char * foeName, int isInstigatedByYou, RESULTTYPE winner, + ITEMTYPE attItem, ITEMTYPE defItem, ITEMTYPE bluffItem, + int pointDelta ); /* Cleanup();