applied TPG's patch, fixed wash
[progcomp10.git] / src / link / C / agents / c_angel.c
1 /*\r
2  *  c_angel.c\r
3  *  c-link-lib\r
4  *\r
5  *  Created by Daniel Axtens on 20/04/10.\r
6  *  Licensed under an MIT-style license: see the LICENSE file for details.\r
7  *\r
8  */\r
9 \r
10 #include <c_link.h>\r
11 \r
12 void * Initialise( char * me ) {\r
13         return NULL;\r
14 }\r
15 \r
16 /* Implement the angel bot, which always tells the truth\r
17    and expects others to do the same */\r
18 \r
19 ATTACKTYPE Attack( void * this, char * foe_name ) {\r
20         ATTACKTYPE attack;\r
21         \r
22         attack.realAttack =  RandomAttack();            /* Chooses randomly from Rock, Paper, Scissors */ \r
23         attack.promisedAttack = attack.realAttack;      /* Tells the truth for its bluff */\r
24 \r
25         return attack;\r
26 }\r
27 \r
28 ITEMTYPE Defend( void * this, char * foeName, ITEMTYPE foePromisedAttack ) {\r
29         return foePromisedAttack;       /* Trusts them to be going for a tie */\r
30 }\r
31 \r
32 /* You need to define a results function, even if it isn't used\r
33    (otherwise the linker will complain) */\r
34 void Results( void * this, char * foeName, int isInstigatedByYou, RESULTTYPE winner,\r
35              ITEMTYPE attItem, ITEMTYPE defItem, ITEMTYPE bluffItem,\r
36              int pointDelta ) {\r
37         \r
38         return; /* Ignore whatever just happened. */\r
39 }\r
40 \r
41 /* same for Cleanup() */\r
42 \r
43 void Cleanup( void * this ) {\r
44         return;\r
45 }\r

UCC git Repository :: git.ucc.asn.au