Fix and integrate BT
This commit is contained in:
43
game/ai_actions.h
Normal file
43
game/ai_actions.h
Normal file
@@ -0,0 +1,43 @@
|
||||
#ifndef PIXELDEFENSE_AI_ACTIONS_H
|
||||
#define PIXELDEFENSE_AI_ACTIONS_H
|
||||
|
||||
#include <breeze.h>
|
||||
#include <flecs.h>
|
||||
|
||||
#include "components.h"
|
||||
|
||||
typedef struct AIBlackboard {
|
||||
ecs_entity_t entity;
|
||||
|
||||
Vector2 moveToPos;
|
||||
|
||||
union {
|
||||
struct {
|
||||
ResourceType harvestType;
|
||||
Vector2 harvestPos;
|
||||
ecs_entity_t harvestTarget;
|
||||
ecs_entity_t depositTarget;
|
||||
} worker;
|
||||
} as;
|
||||
|
||||
f32 proximity;
|
||||
f32 elapsed;
|
||||
} AIBlackboard;
|
||||
|
||||
|
||||
BzBTStatus aiMoveTo(AIBlackboard *data, f32 dt);
|
||||
BzBTStatus aiResetElapsed(AIBlackboard *data, f32 dt);
|
||||
|
||||
// Worker
|
||||
|
||||
BzBTStatus aiFindNextHarvestable(AIBlackboard *data, f32 dt);
|
||||
BzBTStatus aiFindNearestStorage(AIBlackboard *data, f32 dt);
|
||||
BzBTStatus aiHarvestRes(AIBlackboard *data, f32 dt);
|
||||
BzBTStatus aiDepositRes(AIBlackboard *data, f32 dt);
|
||||
BzBTStatus aiCarryCapacityFull(AIBlackboard *data);
|
||||
BzBTStatus aiCarryCapacityEmpty(AIBlackboard *data);
|
||||
//BzBTStatus aiIsTargetHarvestable(AIBlackboard *data);
|
||||
//BzBTStatus aiIsTargetStorage(AIBlackboard *data);
|
||||
|
||||
|
||||
#endif //PIXELDEFENSE_AI_ACTIONS_H
|
||||
Reference in New Issue
Block a user