Add actions

This commit is contained in:
2023-12-17 09:06:14 +01:00
parent 5c1859cf1b
commit 4f2ac9a0eb
14 changed files with 213 additions and 31 deletions

13
game/systems_ai.c Normal file
View File

@@ -0,0 +1,13 @@
#include "systems.h"
#include "game_state.h"
void updateUnitActions(ecs_iter_t *it) {
Game *game = ecs_singleton_get_mut(ECS, Game);
UnitAction *action = ecs_field(it, UnitAction, 1);
for (i32 i = 0; i < it->count; i++) {
ecs_entity_t entity = it->entities[i];
handleAction(entity, &action[i], game);
}
}