Move systems into subdirectory, add tree shake animation

This commit is contained in:
2023-12-29 14:46:11 +01:00
parent aa3bfbf823
commit 31a9289770
15 changed files with 352 additions and 105 deletions

View File

@@ -25,6 +25,9 @@ typedef struct ActionDepositResource {
ecs_entity_t entity;
} ActionDepositResource;
typedef struct Action Action;
typedef void (*ActionCb)(ecs_entity_t entity, Action *action, Game *game);
typedef struct Action {
ActionType type;
union {
@@ -37,6 +40,9 @@ typedef struct Action {
bool finished;
bool failed;
ActionCb onBegin;
ActionCb onFinish;
struct Action *next;
} Action;
@@ -49,6 +55,7 @@ void handleAction(ecs_entity_t entity, UnitAction *unitAction, Game *game);
void updateAction(UnitAction *unitAction, Game *game);
void clearActions(ecs_entity_t entity, Game *game);
void addAction(ecs_entity_t entity, Game *game, const Action *action);
void prependAction(ecs_entity_t entity, Game *game, const Action *action);
const char *actionTypeToPrettyStr(ActionType type);