OpenKKnD/include/ok_types.h
2026-07-11 23:18:44 +02:00

46 lines
753 B
C

#ifndef OK_TYPES_H
#define OK_TYPES_H
#include <stdint.h>
#include <stdbool.h>
#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