This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
napi.h
164 lines (109 loc) · 4.86 KB
/
napi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#ifndef als_bindings_h
#define als_bindings_h
/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#define ALS_DEBUG_ORDERS true
typedef struct ALS_ResourceSet ALS_ResourceSet;
typedef struct ALS_StateListener ALS_StateListener;
typedef struct ALS_Unit ALS_Unit;
typedef struct ALS_UnitType ALS_UnitType;
typedef struct ALS_OrderList ALS_OrderList;
typedef struct ALS_IdList ALS_IdList;
typedef struct ALS_World ALS_World;
typedef float (*ALS_DfuncType)(uint8_t, uint8_t);
typedef void (*ALS_CInitHandle)(void);
typedef void (*ALS_CTurnHandle)(struct ALS_World*, struct ALS_OrderList*);
void alsBeginS_Display(int32_t sw,
int32_t sh,
const char *t,
struct ALS_ResourceSet *rs,
struct ALS_World *w);
void alsBegin_Display(int32_t sw,
int32_t sh,
bool vsync,
uint32_t fps,
const char *t,
struct ALS_ResourceSet *rs,
struct ALS_World *w,
struct ALS_StateListener *sl,
float mvl);
void alsBindDamageFunc(struct ALS_World *w, ALS_DfuncType f);
void alsBindInit(struct ALS_StateListener *sl, ALS_CInitHandle f);
void alsBindTurn(struct ALS_StateListener *sl, ALS_CTurnHandle f);
struct ALS_World *alsBlank_World(void);
void alsCreateStatic(struct ALS_World *w, uint8_t tex_id, int32_t cx, int32_t cy);
void alsDefAnim(struct ALS_UnitType *u,
uint32_t fw,
uint32_t fh,
uint8_t frn,
uint32_t cfx,
uint32_t cfy,
float fr,
bool flip);
void alsDefAnimUnmuted(struct ALS_UnitType *u,
uint32_t fw,
uint32_t fh,
uint8_t frn,
uint32_t cfx,
uint32_t cfy,
float fr,
bool flip,
uint8_t snd,
bool lp);
uint8_t alsGetTypeID(const struct ALS_World *w, uint8_t uid);
struct ALS_IdList *alsIdList(const struct ALS_World *w);
bool alsLoadMap(struct ALS_World *w, const char *fpath);
void alsMapFont(struct ALS_ResourceSet *rs, uint8_t id, const char *path);
void alsMapMusic(struct ALS_ResourceSet *rs, uint8_t id, const char *path);
void alsMapSound(struct ALS_ResourceSet *rs, uint8_t id, const char *path);
void alsMapTexture(struct ALS_ResourceSet *rs, uint8_t id, const char *path);
void alsMapTextureRegion(struct ALS_ResourceSet *rs,
uint8_t tid,
uint8_t parent_id,
float x,
float y,
float w,
float h);
struct ALS_ResourceSet *alsNewResourceSet(void);
struct ALS_StateListener *alsNewStateListener(void);
struct ALS_UnitType *alsNewUnitType(uint8_t tid,
const char *name,
float health,
float mov_rate,
uint8_t movt,
uint8_t ran,
float adur);
void alsRegisterUnitType(struct ALS_World *w, struct ALS_UnitType *u, uint8_t id);
void alsSetUnitInfo(struct ALS_UnitType *u, const char *s);
uint8_t alsSpawnUnit(struct ALS_World *w,
uint8_t tid,
int32_t tx,
int32_t ty,
int32_t tint,
bool plr);
bool alsTilePermAt(const struct ALS_World *w, int32_t x, int32_t y);
bool alsVerifyUID(const struct ALS_World *w, uint8_t uid);
void alsnFreeVec(struct ALS_IdList *v);
float alsnGetUnitHealth(struct ALS_World *w, uint8_t uid);
float alsnGetUnitX(const struct ALS_Unit *w);
float alsnGetUnitY(const struct ALS_Unit *w);
size_t alsnGetWorldHeight(const struct ALS_World *w);
size_t alsnGetWorldWidth(const struct ALS_World *w);
bool alsnIsUnitFoe(const struct ALS_Unit *uref);
void alsnPushAttackOrder(struct ALS_OrderList *i,
uint8_t uid,
uint8_t target,
int32_t tx,
int32_t ty);
void alsnPushDefeatOrder(struct ALS_OrderList *i);
void alsnPushMoveOrder(struct ALS_OrderList *i, uint8_t uid, int32_t tx, int32_t ty);
void alsnPushMutHealthOrder(struct ALS_OrderList *i, uint8_t uid, float val, bool is_rel);
void alsnPushVictoryOrder(struct ALS_OrderList *i);
const struct ALS_Unit *alsnUnitRef(struct ALS_World *w, uint8_t uid);
uint8_t alsnVecAt(const struct ALS_IdList *u, size_t elm);
size_t alsnVecLen(const struct ALS_IdList *u);
#endif /* als_bindings_h */