Implement harvest worker AI
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user