X-Git-Url: https://git.ucc.asn.au/?p=progcomp10.git;a=blobdiff_plain;f=src%2Flink%2FC%2Fagents%2Fc_angel.c;fp=src%2Flink%2FC%2Fagents%2Fc_angel.c;h=d11b551da5f1661b4e109dd69c19cf8dc9ff8d8c;hp=62e214735b1aea21f60fc46494868ff58000eec0;hb=c1e6427973421be71c7cc32b42d7181d6abb8595;hpb=0374e4a4aa10c3a86a6419b260fc0ea7e72c563a diff --git a/src/link/C/agents/c_angel.c b/src/link/C/agents/c_angel.c old mode 100644 new mode 100755 index 62e2147..d11b551 --- a/src/link/C/agents/c_angel.c +++ b/src/link/C/agents/c_angel.c @@ -1,41 +1,45 @@ -/* - * c_angel.c - * c-link-lib - * - * Created by Daniel Axtens on 20/04/10. - * Licensed under an MIT-style license: see the LICENSE file for details. - * - */ - -#include - -/* Implement the angel bot, which always tells the truth - and expects others to do the same */ - -ATTACKTYPE Attack( char * foe_name ) { - ATTACKTYPE attack; - - attack.realAttack = RandomAttack(); /* Chooses randomly from Rock, Paper, Scissors */ - attack.promisedAttack = attack.realAttack; /* Tells the truth for its bluff */ - - return attack; -} - -ITEMTYPE Defend( char * foeName, ITEMTYPE foePromisedAttack ) { - return foePromisedAttack; /* Trusts them to be going for a tie */ -} - -/* You need to define a results function, even if it isn't used - (otherwise the linker will complain) */ -void Results( char * foeName, int isInstigatedByYou, RESULTTYPE winner, - ITEMTYPE attItem, ITEMTYPE defItem, ITEMTYPE bluffItem, - int pointDelta ) { - - return; /* Ignore whatever just happened. */ -} - -/* same for Cleanup() */ - -void Cleanup() { - return; -} \ No newline at end of file +/* + * c_angel.c + * c-link-lib + * + * Created by Daniel Axtens on 20/04/10. + * Licensed under an MIT-style license: see the LICENSE file for details. + * + */ + +#include + +void * Initialise( char * me ) { + return NULL; +} + +/* Implement the angel bot, which always tells the truth + and expects others to do the same */ + +ATTACKTYPE Attack( void * this, char * foe_name ) { + ATTACKTYPE attack; + + attack.realAttack = RandomAttack(); /* Chooses randomly from Rock, Paper, Scissors */ + attack.promisedAttack = attack.realAttack; /* Tells the truth for its bluff */ + + return attack; +} + +ITEMTYPE Defend( void * this, char * foeName, ITEMTYPE foePromisedAttack ) { + return foePromisedAttack; /* Trusts them to be going for a tie */ +} + +/* You need to define a results function, even if it isn't used + (otherwise the linker will complain) */ +void Results( void * this, char * foeName, int isInstigatedByYou, RESULTTYPE winner, + ITEMTYPE attItem, ITEMTYPE defItem, ITEMTYPE bluffItem, + int pointDelta ) { + + return; /* Ignore whatever just happened. */ +} + +/* same for Cleanup() */ + +void Cleanup( void * this ) { + return; +}