#ifndef OK_TYPES_H #define OK_TYPES_H #include #include #define OK_MAP_W 64 #define OK_MAP_H 48 #define OK_MAX_UNITS 256 typedef enum { OK_FACTION_SURVIVORS = 0, OK_FACTION_SCAVENGERS = 1 } OkFaction; typedef enum { OK_UNIT_INFANTRY = 0, OK_UNIT_VEHICLE = 1 } OkUnitKind; typedef struct { int x, y; OkFaction faction; OkUnitKind kind; int hp; int hp_max; int target; /* unit index or -1 */ bool alive; } OkUnit; typedef struct { uint8_t tile[OK_MAP_H][OK_MAP_W]; /* 0 empty, 1 blocked, 2 resource */ } OkMap; typedef struct { OkMap map; OkUnit units[OK_MAX_UNITS]; int unit_count; int selected; bool running; bool survivors_win; bool scavengers_win; uint32_t tick; } OkGame; #endif