root/trunk/src/game-cmd.h

Revision 918, 1.6 kB (checked in by takkaria, 5 months ago)

Use consistent newlines everywhere, and also set the svn:eol-style property to native on all text files.

  • Property svn:eol-style set to native
Line 
1
2 /*
3  * All valid game commands.  Not all implemented yet.
4  */
5 typedef enum cmd_code
6 {
7         CMD_NULL,       /* A "do nothing" command so that there's something
8                            UIs can use as a "no command yet" sentinel. */
9
10         CMD_QUIT,
11         CMD_OPTIONS,
12
13         /* Splash screen commands */
14         CMD_LOADFILE,
15         CMD_NEWGAME,
16
17         /* Birth commands */
18         CMD_BIRTH_BACK,
19         CMD_BIRTH_RESTART,
20         CMD_BIRTH_CHOICE,
21         CMD_BUY_STAT,
22         CMD_SELL_STAT,
23         CMD_AUTOROLL,
24         CMD_ROLL,
25         CMD_PREV_STATS,
26         CMD_ACCEPT_STATS,
27         CMD_NAME_CHOICE,
28         CMD_ACCEPT_CHARACTER
29 } cmd_code;
30
31
32 /*
33  * The game_command type is used to return details of the command the
34  * game should carry out.
35  *
36  * 'command' should always have a valid cmd_code value, the other entries
37  * may or may not be significant depending on the command being returned.
38  *
39  * NOTE: This is prone to change quite a bit while things are shaken out.
40  */
41 typedef struct game_command
42 {
43         /* A valid command code. */
44         cmd_code command;
45
46         /*
47          * Probably handle "special" repetitions like '*' as negative
48          * ones, as classically we limit repeats to 9999 anyway
49          */
50         int repeat;
51
52         union
53         {
54                 const char *string;
55                 int choice;
56
57                 int direction;
58
59                 struct
60                 {
61                         int x;
62                         int y;
63                 } point;
64
65                 struct
66                 {
67                         int idx;
68                         int minimum;
69                 } stat_min;
70
71                 struct
72                 {
73                         object_type *object_used;
74                         union
75                         {
76                                 object_type *object;
77                                
78                                 struct
79                                 {
80                                         int x;
81                                         int y;
82                                 } point;
83                                
84                                 int direction;
85                         } target;
86                 } object;
87
88                 int stat_limits[A_MAX];
89         } params;
90 } game_command;
91
92
93 /*
94  * A function called by the game to get a command from the UI.
95  * Just a hook, with the real function supplied by the UI.
96  */
97 extern game_command (*get_game_command)(void);
Note: See TracBrowser for help on using the browser.