build: CMake and public headers
This commit is contained in:
parent
1455cf7ac9
commit
87d99f7007
6 changed files with 107 additions and 0 deletions
46
include/ok_types.h
Normal file
46
include/ok_types.h
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue