Remove AI prefix from behaviour_tree
This commit is contained in:
@@ -3,99 +3,99 @@
|
||||
|
||||
#include "../defines.h"
|
||||
|
||||
typedef struct BzAIBTNode BzAIBTNode;
|
||||
typedef struct BzBTNode BzBTNode;
|
||||
|
||||
typedef enum BzAIBTStatus {
|
||||
BZ_AIBT_RUNNING,
|
||||
BZ_AIBT_SUCCESS,
|
||||
BZ_AIBT_FAIL,
|
||||
BZ_AIBT_ERROR,
|
||||
} BzAIBTStatus;
|
||||
typedef enum BzBTStatus {
|
||||
BZ_BT_RUNNING,
|
||||
BZ_BT_SUCCESS,
|
||||
BZ_BT_FAIL,
|
||||
BZ_BT_ERROR,
|
||||
} BzBTStatus;
|
||||
|
||||
typedef BzAIBTStatus(*BzAIBTActionFn)(void *data);
|
||||
typedef BzBTStatus(*BzBTActionFn)(void *data);
|
||||
|
||||
typedef enum BzAIBTNodeType {
|
||||
typedef enum BzBTNodeType {
|
||||
// Composite
|
||||
BZ_AIBT_COMP_SELECTOR,
|
||||
BZ_AIBT_COMP_SEQUENCE,
|
||||
BZ_AIBT_COMP_PARALLEL_SELECTOR,
|
||||
BZ_AIBT_COMP_PARALLEL_SEQUENCE,
|
||||
BZ_BT_COMP_SELECTOR,
|
||||
BZ_BT_COMP_SEQUENCE,
|
||||
BZ_BT_COMP_PARALLEL_SELECTOR,
|
||||
BZ_BT_COMP_PARALLEL_SEQUENCE,
|
||||
// Decorator
|
||||
BZ_AIBT_DECOR_DUMMY,
|
||||
BZ_AIBT_DECOR_SUCCESS,
|
||||
BZ_AIBT_DECOR_FAIL,
|
||||
BZ_AIBT_DECOR_INVERT,
|
||||
BZ_AIBT_DECOR_UNTIL_SUCCESS,
|
||||
BZ_AIBT_DECOR_UNTIL_FAIL,
|
||||
BZ_AIBT_DECOR_REPEAT,
|
||||
BZ_AIBT_DECOR_DELAY,
|
||||
BZ_BT_DECOR_DUMMY,
|
||||
BZ_BT_DECOR_SUCCESS,
|
||||
BZ_BT_DECOR_FAIL,
|
||||
BZ_BT_DECOR_INVERT,
|
||||
BZ_BT_DECOR_UNTIL_SUCCESS,
|
||||
BZ_BT_DECOR_UNTIL_FAIL,
|
||||
BZ_BT_DECOR_REPEAT,
|
||||
BZ_BT_DECOR_DELAY,
|
||||
// Action/Task
|
||||
BZ_AIBT_ACTION,
|
||||
} BzAIBTNodeType;
|
||||
BZ_BT_ACTION,
|
||||
} BzBTNodeType;
|
||||
|
||||
typedef struct BzObjectPool BzObjectPool;
|
||||
typedef struct BzAIBTNodeState BzAIBTNodeState;
|
||||
typedef struct BzBTNodeState BzBTNodeState;
|
||||
|
||||
typedef struct BzAIBTState {
|
||||
const BzAIBTNode *root;
|
||||
BzAIBTNodeState *first;
|
||||
BzAIBTNodeState *last;
|
||||
typedef struct BzBTState {
|
||||
const BzBTNode *root;
|
||||
BzBTNodeState *first;
|
||||
BzBTNodeState *last;
|
||||
|
||||
BzObjectPool *nodeStatePool;
|
||||
void *userData;
|
||||
} BzAIBTState;
|
||||
} BzBTState;
|
||||
|
||||
typedef struct BzAIBTStateDesc {
|
||||
const BzAIBTNode *root;
|
||||
typedef struct BzBTStateDesc {
|
||||
const BzBTNode *root;
|
||||
|
||||
BzObjectPool *pool;
|
||||
void *userData;
|
||||
} BzAIBTStateDesc;
|
||||
} BzBTStateDesc;
|
||||
|
||||
size_t bzAIBTGetNodeSize();
|
||||
size_t bzAIBTGetNodeStateSize();
|
||||
size_t bzBTGetNodeSize();
|
||||
size_t bzBTGetNodeStateSize();
|
||||
|
||||
const char *bzAIBTNodeTypeToStr(BzAIBTNodeType type);
|
||||
const char *bzBTNodeTypeToStr(BzBTNodeType type);
|
||||
|
||||
BzAIBTNode *bzAIBTMakeRoot(BzObjectPool *nodePool);
|
||||
void bzAIBTDestroyRoot(BzObjectPool *nodePool, BzAIBTNode *node);
|
||||
BzBTNode *bzBTMakeRoot(BzObjectPool *nodePool);
|
||||
void bzBTDestroyRoot(BzObjectPool *nodePool, BzBTNode *node);
|
||||
|
||||
BzAIBTNode *bzAIBTCompSelector(BzObjectPool *nodePool, BzAIBTNode *parent, bool parallel);
|
||||
BzAIBTNode *bzAIBTCompSequence(BzObjectPool *nodePool, BzAIBTNode *parent, bool parallel);
|
||||
BzBTNode *bzBTCompSelector(BzObjectPool *nodePool, BzBTNode *parent, bool parallel);
|
||||
BzBTNode *bzBTCompSequence(BzObjectPool *nodePool, BzBTNode *parent, bool parallel);
|
||||
|
||||
BzAIBTNode *bzAIBTDecorDummy(BzObjectPool *nodePool, BzAIBTNode *parent);
|
||||
BzAIBTNode *bzAIBTDecorSuccess(BzObjectPool *nodePool, BzAIBTNode *parent);
|
||||
BzAIBTNode *bzAIBTDecorFail(BzObjectPool *nodePool, BzAIBTNode *parent);
|
||||
BzAIBTNode *bzAIBTDecorInvert(BzObjectPool *nodePool, BzAIBTNode *parent);
|
||||
BzAIBTNode *bzAIBTDecorUntilSuccess(BzObjectPool *nodePool, BzAIBTNode *parent);
|
||||
BzAIBTNode *bzAIBTDecorUntilFail(BzObjectPool *nodePool, BzAIBTNode *parent);
|
||||
BzAIBTNode *bzAIBTDecorRepeat(BzObjectPool *nodePool, BzAIBTNode *parent, i32 n);
|
||||
BzAIBTNode *bzAIBTDecorDelay(BzObjectPool *nodePool, BzAIBTNode *parent, f32 ms);
|
||||
BzBTNode *bzBTDecorDummy(BzObjectPool *nodePool, BzBTNode *parent);
|
||||
BzBTNode *bzBTDecorSuccess(BzObjectPool *nodePool, BzBTNode *parent);
|
||||
BzBTNode *bzBTDecorFail(BzObjectPool *nodePool, BzBTNode *parent);
|
||||
BzBTNode *bzBTDecorInvert(BzObjectPool *nodePool, BzBTNode *parent);
|
||||
BzBTNode *bzBTDecorUntilSuccess(BzObjectPool *nodePool, BzBTNode *parent);
|
||||
BzBTNode *bzBTDecorUntilFail(BzObjectPool *nodePool, BzBTNode *parent);
|
||||
BzBTNode *bzBTDecorRepeat(BzObjectPool *nodePool, BzBTNode *parent, i32 n);
|
||||
BzBTNode *bzBTDecorDelay(BzObjectPool *nodePool, BzBTNode *parent, f32 ms);
|
||||
|
||||
BzAIBTNode *bzAIBTAction(BzObjectPool *nodePool, BzAIBTNode *parent, BzAIBTActionFn fn,
|
||||
const char *name);
|
||||
BzBTNode *bzBTAction(BzObjectPool *nodePool, BzBTNode *parent, BzBTActionFn fn,
|
||||
const char *name);
|
||||
|
||||
// Reflection data
|
||||
|
||||
i32 bzAIBTDecorGetRepeat(const BzAIBTNode *node);
|
||||
f32 bzAIBTDecorGetDelay(const BzAIBTNode *node);
|
||||
i32 bzBTDecorGetRepeat(const BzBTNode *node);
|
||||
f32 bzBTDecorGetDelay(const BzBTNode *node);
|
||||
|
||||
BzAIBTActionFn bzAIBTActionGetFn(const BzAIBTNode *node);
|
||||
const char *bzAIBTActionGetName(const BzAIBTNode *node);
|
||||
BzBTActionFn bzBTActionGetFn(const BzBTNode *node);
|
||||
const char *bzBTActionGetName(const BzBTNode *node);
|
||||
|
||||
BzAIBTNodeType bzAIBTGetNodeType(const BzAIBTNode *node);
|
||||
BzAIBTNode *bzAIBTNodeChild(const BzAIBTNode *node);
|
||||
BzAIBTNode *bzAIBTNodeNext(const BzAIBTNode *node);
|
||||
BzBTNodeType bzBTGetNodeType(const BzBTNode *node);
|
||||
BzBTNode *bzBTNodeChild(const BzBTNode *node);
|
||||
BzBTNode *bzBTNodeNext(const BzBTNode *node);
|
||||
|
||||
const BzAIBTNodeState *bzAIBTNodeStateNext(const BzAIBTNodeState *state);
|
||||
bool bzAIBTNodeMatchesState(const BzAIBTNode *node, const BzAIBTNodeState *state);
|
||||
const BzBTNodeState *bzBTNodeStateNext(const BzBTNodeState *state);
|
||||
bool bzBTNodeMatchesState(const BzBTNode *node, const BzBTNodeState *state);
|
||||
|
||||
i32 bzAIBTRepeatStateGetIter(const BzAIBTNodeState *state);
|
||||
f32 bzAIBTDelayStateGetElapsed(const BzAIBTNodeState *state);
|
||||
i32 bzBTRepeatStateGetIter(const BzBTNodeState *state);
|
||||
f32 bzBTDelayStateGetElapsed(const BzBTNodeState *state);
|
||||
|
||||
BzAIBTState bzAIBTCreateState(const BzAIBTStateDesc *desc);
|
||||
void bzAIBTDestroyState(BzAIBTState *state);
|
||||
BzBTState bzBTCreateState(const BzBTStateDesc *desc);
|
||||
void bzBTDestroyState(BzBTState *state);
|
||||
|
||||
BzAIBTStatus bzAIBTExecute(BzAIBTState *state, f32 dt);
|
||||
BzBTStatus bzBTExecute(BzBTState *state, f32 dt);
|
||||
|
||||
#endif //BREEZE_BEHAVIOUR_TREE_H
|
||||
|
||||
Reference in New Issue
Block a user