Implement harvest worker AI

This commit is contained in:
2023-12-17 14:20:13 +01:00
parent 5564df4768
commit 33b28b620d
14 changed files with 338 additions and 40 deletions

View File

@@ -19,10 +19,10 @@ typedef struct ActionMoveTo {
f32 proximityThreshold;
} ActionMoveTo;
typedef struct ActionCollectResource {
ecs_entity_t entity;
} ActionCollectResource;
typedef struct ActionDepositResource {
ecs_entity_t entity;
} ActionDepositResource;
typedef struct Action {
@@ -35,6 +35,7 @@ typedef struct Action {
f32 elapsed;
bool finished;
bool failed;
struct Action *next;
} Action;
@@ -45,7 +46,10 @@ typedef struct UnitAction {
} UnitAction;
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);
const char *actionTypeToPrettyStr(ActionType type);
#endif //PIXELDEFENSE_UNIT_ACTIONS_H