aboutsummaryrefslogtreecommitdiff
path: root/src/unit/inc/unit.h
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-01-28 03:01:13 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-01-28 15:17:49 +0100
commitfd53c7da8c5f2b79b87f624e313ff508072361ad (patch)
treedb569413cd3d42034a22368a7980aa99d7d55235 /src/unit/inc/unit.h
parente49e3073c67af785447ddb0ecbdc521b68cf3ea9 (diff)
Big rushed update
Diffstat (limited to 'src/unit/inc/unit.h')
-rw-r--r--src/unit/inc/unit.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/unit/inc/unit.h b/src/unit/inc/unit.h
index 8d3e1bf..c9abafe 100644
--- a/src/unit/inc/unit.h
+++ b/src/unit/inc/unit.h
@@ -33,17 +33,14 @@ struct unit
{
struct instance instance;
enum unit_type type;
+ const char *name;
enum unit_dir
{
- UNIT_DIR_N,
- UNIT_DIR_NE,
- UNIT_DIR_E,
- UNIT_DIR_SE,
- UNIT_DIR_S,
- UNIT_DIR_SW,
UNIT_DIR_W,
- UNIT_DIR_NW
+ UNIT_DIR_S,
+ UNIT_DIR_N,
+ UNIT_DIR_E
} dir;
enum unit_state state;
@@ -61,7 +58,12 @@ UTIL_STATIC_ASSERT(!offsetof(struct unit, instance), "must be at offset zero");
struct unit_cfg
{
- enum unit_type type;
+ enum
+ {
+ UNIT_CFG_TYPE_WALKER,
+ UNIT_CFG_TYPE_CAR
+ } type;
+
unsigned long x, y;
};
@@ -72,7 +74,6 @@ bool unit_target_valid(const struct unit *u, const struct unit_target *t);
void unit_set_target(struct unit *u, const struct unit_target *t);
void unit_move_to(struct unit *u, unsigned long x, unsigned long y);
void unit_update(struct unit *u);
-const char *unit_str(const struct unit *u);
enum
{
@@ -82,6 +83,8 @@ enum
UNIT_4_SPRITE,
UNIT_5_SPRITE,
UNIT_6_SPRITE,
+ UNIT_CAR_1_SPRITE,
+ UNIT_CAR_2_SPRITE,
MAX_UNIT_SPRITES
};