mirror of
https://git.planet-casio.com/Slyvtt/Collab_RPG.git
synced 2025-01-01 14:33:39 +01:00
36 lines
630 B
C
36 lines
630 B
C
|
#ifndef EVENTS_H
|
||
|
#define EVENTS_H
|
||
|
|
||
|
#define MAX_VARIABLES 32
|
||
|
#define MESSAGE_BUFFER_SZ 256
|
||
|
#define TOKEN_MAX_SZ 32
|
||
|
|
||
|
typedef struct {
|
||
|
int *variables[MAX_VARIABLES];
|
||
|
char *var_names[MAX_VARIABLES];
|
||
|
unsigned int vars;
|
||
|
} EventHandler;
|
||
|
|
||
|
typedef enum {
|
||
|
T_NULL,
|
||
|
T_VAR_EDIT,
|
||
|
T_AMOUNT
|
||
|
} Token;
|
||
|
|
||
|
typedef enum {
|
||
|
OP_NULL,
|
||
|
OP_SET,
|
||
|
OP_ADD,
|
||
|
OP_SUB,
|
||
|
OP_DIV,
|
||
|
OP_MUL,
|
||
|
OP_MOD,
|
||
|
OP_AMOUNT
|
||
|
} Operation;
|
||
|
|
||
|
void events_init_handler(EventHandler *handler);
|
||
|
int events_bind_variable(EventHandler *handler, int *var, char *name);
|
||
|
char *events_parse_string(EventHandler *handler, char *message);
|
||
|
|
||
|
#endif
|