Skip to content

Commit

Permalink
expose BeehaveTree on context
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbrain committed Jan 13, 2024
1 parent 4ad288e commit 482fab8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
Binary file modified addons/beehave/libs/windows/beehave.windows.editor.x86_64.dll
Binary file not shown.
12 changes: 12 additions & 0 deletions extension/src/beehave_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ using namespace godot;

void BeehaveContext::_bind_methods()
{
ClassDB::bind_method(D_METHOD("set_tree", "tree"), &BeehaveContext::set_tree);
ClassDB::bind_method(D_METHOD("get_tree"), &BeehaveContext::get_tree);
ClassDB::bind_method(D_METHOD("set_blackboard", "blackboard"), &BeehaveContext::set_blackboard);
ClassDB::bind_method(D_METHOD("get_blackboard"), &BeehaveContext::get_blackboard);
ClassDB::bind_method(D_METHOD("set_actor", "actor"), &BeehaveContext::set_actor);
Expand All @@ -41,6 +43,16 @@ void BeehaveContext::_bind_methods()
ClassDB::bind_method(D_METHOD("get_delta"), &BeehaveContext::get_delta);
}

BeehaveTree* BeehaveContext::get_tree() const
{
return this->tree;
}

void BeehaveContext::set_tree(BeehaveTree* tree)
{
this->tree = tree;
}

BeehaveBlackboard* BeehaveContext::get_blackboard() const
{
return this->blackboard;
Expand Down
5 changes: 5 additions & 0 deletions extension/src/beehave_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,24 @@
#include <classes/ref_counted.hpp>
#include <classes/node.hpp>
#include "nodes/beehave_blackboard.h"
#include "nodes/beehave_tree.h"

namespace godot {

class BeehaveContext : public RefCounted
{
GDCLASS(BeehaveContext, RefCounted);

BeehaveTree* tree;
BeehaveBlackboard* blackboard;
Node* actor;
float delta;
protected:
static void _bind_methods();
public:
BeehaveTree* get_tree() const;
void set_tree(BeehaveTree* tree);

BeehaveBlackboard* get_blackboard() const;
void set_blackboard(BeehaveBlackboard* blackboard);

Expand Down

0 comments on commit 482fab8

Please sign in to comment.