projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correct return types for all of the action handling functions in actions, so it's...
[open-adventure.git]
/
advent.h
diff --git
a/advent.h
b/advent.h
index 321e0363417c332f079e4a00da1ad0cb930eaa98..dc81ed5fd55b6e9c625bfc281493ffc4c441f243 100644
(file)
--- a/
advent.h
+++ b/
advent.h
@@
-102,18
+102,16
@@
typedef enum scorebonus {none, splatter, defeat, victory} score_t;
* These were at one time FORTRAN line numbers.
* The values don't matter, but perturb their order at your peril.
*/
* These were at one time FORTRAN line numbers.
* The values don't matter, but perturb their order at your peril.
*/
-
enum phase_codes
{
+
typedef enum
{
GO_TERMINATE,
GO_MOVE,
GO_TOP,
GO_CLEAROBJ,
GO_CHECKHINT,
GO_TERMINATE,
GO_MOVE,
GO_TOP,
GO_CLEAROBJ,
GO_CHECKHINT,
- GO_CHECKFOO,
- GO_LOOKUP,
GO_WORD2,
GO_UNKNOWN,
GO_DWARFWAKE,
GO_WORD2,
GO_UNKNOWN,
GO_DWARFWAKE,
-};
+}
phase_codes_t
;
typedef long vocab_t; // index into a vocabulary array */
typedef long verb_t; // index into an actions array */
typedef long vocab_t; // index into a vocabulary array */
typedef long verb_t; // index into an actions array */
@@
-198,20
+196,24
@@
typedef struct {
word_type_t type;
} command_word_t;
word_type_t type;
} command_word_t;
+typedef enum {EMPTY, RAW, TOKENIZED, GIVEN, PREPROCESSED, PROCESSING, EXECUTED} command_state_t;
+
typedef struct {
enum speechpart part;
command_word_t word[2];
verb_t verb;
typedef struct {
enum speechpart part;
command_word_t word[2];
verb_t verb;
- obj_t obj;
+ obj_t obj;
+ command_state_t state;
} command_t;
extern struct game_t game;
extern struct settings_t settings;
extern bool get_command_input(command_t *);
} command_t;
extern struct game_t game;
extern struct settings_t settings;
extern bool get_command_input(command_t *);
+extern void clear_command(command_t *);
extern void speak(const char*, ...);
extern void sspeak(int msg, ...);
extern void speak(const char*, ...);
extern void sspeak(int msg, ...);
-extern void pspeak(vocab_t, enum speaktype,
int, bool
, ...);
+extern void pspeak(vocab_t, enum speaktype,
bool, int
, ...);
extern void rspeak(vocab_t, ...);
extern void echo_input(FILE*, const char*, const char*);
extern bool silent_yes(void);
extern void rspeak(vocab_t, ...);
extern void echo_input(FILE*, const char*, const char*);
extern bool silent_yes(void);
@@
-233,7
+235,7
@@
extern int suspend(void);
extern int resume(void);
extern int restore(FILE *);
extern long initialise(void);
extern int resume(void);
extern int restore(FILE *);
extern long initialise(void);
-extern
int action(command_t command
);
+extern
phase_codes_t action(command_t
);
extern void state_change(obj_t, int);
extern bool is_valid(struct game_t);
extern void state_change(obj_t, int);
extern bool is_valid(struct game_t);