summaryrefslogtreecommitdiff
path: root/entry.h
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-01-08 15:04:26 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-01-08 15:37:48 +0100
commit1f9c71b49eeef9cd05b542515c06200b4a25f693 (patch)
tree6a29ab8af1ae447236013cbd78e5089937b72b1f /entry.h
parentadceeb1192fdd1d14e0f55219bbd1bcb14eacc05 (diff)
use a generic way to navigate through entries
entries are actually any action or subaction that can be performed. Attack, White Magic and so on are root actions. Fire, Ice X are subactions of Black Magic. Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'entry.h')
-rw-r--r--entry.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/entry.h b/entry.h
new file mode 100644
index 0000000..00b58e9
--- /dev/null
+++ b/entry.h
@@ -0,0 +1,30 @@
+#ifndef ENTRY_H
+#define ENTRY_H
+
+#include "structures.h"
+#include "players.h"
+
+struct entry_t {
+ /* displayed name */
+ char *name;
+ int children_cnt;
+
+ union {
+ struct entry_t *children;
+
+ struct {
+ void *data;
+ enum action_state_t (*f)(SURFACES *, POSITIONS *, struct team_t *, struct team_t *, void *data);
+ };
+ };
+};
+
+struct action_params_t {
+ SURFACES *surfaces;
+ POSITIONS *positions;
+
+ struct team_t *t1;
+ struct team_t *t2;
+};
+
+#endif /* ENTRY_H */