initial import, after some monkeying around
[progcomp10.git] / link / C / Link / c-link-lib / c-link.h
1 /*
2  *  c-link.h
3  *  c-link-lib
4  *
5  *  Created by Daniel Axtens on 19/04/10.
6  *  Licensed under an MIT-style license: see the LICENSE file for details.
7  *
8  */
9
10 /********** Type definitions **********/
11
12 /* The type of item used in an attack or defence */
13 typedef enum {rock, paper, scissors} ITEMTYPE;
14
15
16 /* An attack, consisting of the real attack and the attack promised */
17 typedef struct {
18         ITEMTYPE realAttack;
19         ITEMTYPE promisedAttack;
20 } ATTACKTYPE;
21
22 /********** Utility Function definitions **********/
23
24 /* Returns a random item */
25
26 ITEMTYPE RandomAttack();
27
28 /********** Bot Function definitions **********/
29
30 /* Defend( foeName : string - the name of your foe;
31            foePromisedAttack : ITEMTYPE - the item your foe promised to use
32          ) : ITEMTYPE - the item you wish to use to defend;
33  
34  Called when your agent needs to defend itself.
35  
36  */
37 ITEMTYPE Defend( char * foeName, ITEMTYPE foePromisedAttack );
38
39
40 /* Attack( foeName : string - the name of your foe
41                  ) : ATTACKTYPE - the real and promised attack you wish to use
42
43  Called when your agent needs to attack another agent.
44  
45  */
46 ATTACKTYPE Attack( char * foeName );
47
48
49 /* Results( foeName : string - the name of your foe;
50             isInstigatedByYou : 0=you defended/1=you attacked;
51                         yourItem : ITEMTYPE - the item you used;
52             theirItem : ITEMTYPE - the item they used;
53             promisedItem : ITEMTYPE - the item that was promised
54           );
55
56  Called after your agent battles another agent, to tell you how the battle goes.
57  
58  */
59 void Results( char * foeName, int isInstigatedByYou, ITEMTYPE yourItem, 
60                           ITEMTYPE theirItem, ITEMTYPE promisedItem);

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