aboutsummaryrefslogtreecommitdiff
path: root/gst/units.h
diff options
context:
space:
mode:
authorjacopo grandi <jak.sk8@hotmail.it>2021-02-18 14:14:23 +0100
committerjacopo grandi <jak.sk8@hotmail.it>2021-02-18 14:14:23 +0100
commit5f0fce4191309e9526b7109a0d87c092ce6a4193 (patch)
tree105257f876551814aa74a0760ec116bd1bf307a5 /gst/units.h
parentead78d51e662057467b79d3a65b20c4ba83cbf07 (diff)
main
Diffstat (limited to 'gst/units.h')
-rw-r--r--gst/units.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/gst/units.h b/gst/units.h
new file mode 100644
index 0000000..86f7fd7
--- /dev/null
+++ b/gst/units.h
@@ -0,0 +1,40 @@
+#ifndef UNITS_H
+#define UNITS_H
+
+#define MAXUNITS 128
+#define MAXSOLVESTEPS 128
+
+#include <info.h>
+
+typedef struct unit_ {
+ float pos[2];
+ int gridpos[2];
+ info_unit info;
+ int owner;
+ float hp;
+ float move_points;
+ float cooldown[8];
+ float charge;
+} unit;
+
+typedef struct army_ {
+ unit us[MAXUNITS];
+ unit **grid;
+ int uslen;
+ int sx, sy;
+} army;
+
+
+#include <map.h>
+
+void unit_init (infos *info, army *ar, map *m,
+ int x, int y, info_unit *iu, int owner, unit *u);
+void unit_remove (army *ar, map *m, unit *u);
+void army_grid_init(army *ar);
+void army_init (army *ar, map *m);
+void army_destory(army *ar);
+void army_spawn (army *ar, map *m, unit u);
+void army_move (infos *info, army *ar, map *m);
+void army_fire (infos *info, army *ar, map *m);
+
+#endif \ No newline at end of file