2022-08-28 10:54:34 +00:00
|
|
|
/* register_types.cpp */
|
|
|
|
|
|
|
|
#include "register_types.h"
|
|
|
|
|
|
|
|
#include "core/class_db.h"
|
|
|
|
|
2022-09-08 13:56:51 +00:00
|
|
|
#include "blackboard.h"
|
2022-08-31 15:05:25 +00:00
|
|
|
#include "bt/actions/bt_action.h"
|
2022-09-06 11:08:52 +00:00
|
|
|
#include "bt/actions/bt_console_print.h"
|
2022-08-31 15:05:25 +00:00
|
|
|
#include "bt/actions/bt_fail.h"
|
|
|
|
#include "bt/actions/bt_random_wait.h"
|
|
|
|
#include "bt/actions/bt_wait.h"
|
|
|
|
#include "bt/actions/bt_wait_ticks.h"
|
2022-08-30 16:48:49 +00:00
|
|
|
#include "bt/behavior_tree.h"
|
|
|
|
#include "bt/bt_player.h"
|
2022-08-28 20:58:30 +00:00
|
|
|
#include "bt/bt_task.h"
|
2022-08-31 15:05:25 +00:00
|
|
|
#include "bt/composites/bt_composite.h"
|
|
|
|
#include "bt/composites/bt_dynamic_selector.h"
|
|
|
|
#include "bt/composites/bt_dynamic_sequence.h"
|
|
|
|
#include "bt/composites/bt_parallel.h"
|
|
|
|
#include "bt/composites/bt_random_selector.h"
|
|
|
|
#include "bt/composites/bt_random_sequence.h"
|
|
|
|
#include "bt/composites/bt_selector.h"
|
|
|
|
#include "bt/composites/bt_sequence.h"
|
|
|
|
#include "bt/conditions/bt_condition.h"
|
|
|
|
#include "bt/decorators/bt_always_fail.h"
|
|
|
|
#include "bt/decorators/bt_always_succeed.h"
|
|
|
|
#include "bt/decorators/bt_cooldown.h"
|
|
|
|
#include "bt/decorators/bt_decorator.h"
|
|
|
|
#include "bt/decorators/bt_delay.h"
|
2022-09-22 11:09:49 +00:00
|
|
|
#include "bt/decorators/bt_for_each.h"
|
2022-08-31 15:05:25 +00:00
|
|
|
#include "bt/decorators/bt_invert.h"
|
2022-09-20 17:15:48 +00:00
|
|
|
#include "bt/decorators/bt_new_scope.h"
|
2022-08-31 15:05:25 +00:00
|
|
|
#include "bt/decorators/bt_probability.h"
|
|
|
|
#include "bt/decorators/bt_repeat.h"
|
|
|
|
#include "bt/decorators/bt_repeat_until_failure.h"
|
|
|
|
#include "bt/decorators/bt_repeat_until_success.h"
|
|
|
|
#include "bt/decorators/bt_run_limit.h"
|
2022-09-20 17:15:48 +00:00
|
|
|
#include "bt/decorators/bt_subtree.h"
|
2022-08-31 15:05:25 +00:00
|
|
|
#include "bt/decorators/bt_time_limit.h"
|
2022-09-21 21:56:04 +00:00
|
|
|
#include "core/os/memory.h"
|
2022-09-28 10:48:45 +00:00
|
|
|
#include "limbo_state.h"
|
2022-08-28 10:54:34 +00:00
|
|
|
#include "limbo_string_names.h"
|
|
|
|
#include "limbo_utility.h"
|
|
|
|
|
2022-09-01 22:20:37 +00:00
|
|
|
#ifdef TOOLS_ENABLED
|
|
|
|
#include "editor/limbo_ai_editor_plugin.h"
|
|
|
|
#endif
|
|
|
|
|
2022-09-21 21:56:04 +00:00
|
|
|
static LimboUtility *_limbo_utility = nullptr;
|
|
|
|
|
2022-08-28 10:54:34 +00:00
|
|
|
void register_limboai_types() {
|
2022-09-08 13:56:51 +00:00
|
|
|
ClassDB::register_class<Blackboard>();
|
2022-09-28 10:48:45 +00:00
|
|
|
|
|
|
|
ClassDB::register_class<LimboState>();
|
|
|
|
|
2022-08-28 10:54:34 +00:00
|
|
|
ClassDB::register_class<BTTask>();
|
2022-08-30 16:48:49 +00:00
|
|
|
ClassDB::register_class<BehaviorTree>();
|
|
|
|
ClassDB::register_class<BTPlayer>();
|
2022-08-28 13:34:04 +00:00
|
|
|
|
2022-08-28 10:54:34 +00:00
|
|
|
ClassDB::register_class<BTComposite>();
|
|
|
|
ClassDB::register_class<BTSequence>();
|
2022-08-28 21:36:21 +00:00
|
|
|
ClassDB::register_class<BTDynamicSequence>();
|
|
|
|
ClassDB::register_class<BTDynamicSelector>();
|
2022-08-28 10:54:34 +00:00
|
|
|
ClassDB::register_class<BTSelector>();
|
2022-08-29 09:41:42 +00:00
|
|
|
ClassDB::register_class<BTRandomSelector>();
|
|
|
|
ClassDB::register_class<BTRandomSequence>();
|
|
|
|
ClassDB::register_class<BTSelector>();
|
2022-08-28 10:54:34 +00:00
|
|
|
ClassDB::register_class<BTParallel>();
|
2022-08-28 21:36:21 +00:00
|
|
|
|
2022-08-31 15:05:25 +00:00
|
|
|
ClassDB::register_class<BTDecorator>();
|
2022-08-28 11:56:43 +00:00
|
|
|
ClassDB::register_class<BTInvert>();
|
|
|
|
ClassDB::register_class<BTAlwaysFail>();
|
|
|
|
ClassDB::register_class<BTAlwaysSucceed>();
|
|
|
|
ClassDB::register_class<BTDelay>();
|
2022-08-28 12:49:02 +00:00
|
|
|
ClassDB::register_class<BTRepeat>();
|
|
|
|
ClassDB::register_class<BTRepeatUntilFailure>();
|
|
|
|
ClassDB::register_class<BTRepeatUntilSuccess>();
|
2022-08-28 13:24:01 +00:00
|
|
|
ClassDB::register_class<BTRunLimit>();
|
2022-08-28 13:34:04 +00:00
|
|
|
ClassDB::register_class<BTTimeLimit>();
|
2022-08-28 20:24:33 +00:00
|
|
|
ClassDB::register_class<BTCooldown>();
|
2022-08-28 20:58:30 +00:00
|
|
|
ClassDB::register_class<BTProbability>();
|
2022-09-22 11:09:49 +00:00
|
|
|
ClassDB::register_class<BTForEach>();
|
2022-08-28 21:36:21 +00:00
|
|
|
|
2022-08-31 15:05:25 +00:00
|
|
|
ClassDB::register_class<BTAction>();
|
2022-08-29 11:30:53 +00:00
|
|
|
ClassDB::register_class<BTFail>();
|
2022-08-29 12:06:48 +00:00
|
|
|
ClassDB::register_class<BTWait>();
|
|
|
|
ClassDB::register_class<BTRandomWait>();
|
|
|
|
ClassDB::register_class<BTWaitTicks>();
|
2022-09-20 17:15:48 +00:00
|
|
|
ClassDB::register_class<BTNewScope>();
|
2022-09-03 18:42:38 +00:00
|
|
|
ClassDB::register_class<BTSubtree>();
|
2022-09-06 11:08:52 +00:00
|
|
|
ClassDB::register_class<BTConsolePrint>();
|
2022-08-29 11:30:53 +00:00
|
|
|
|
2022-08-31 15:05:25 +00:00
|
|
|
ClassDB::register_class<BTCondition>();
|
|
|
|
|
2022-09-21 21:56:04 +00:00
|
|
|
_limbo_utility = memnew(LimboUtility);
|
|
|
|
ClassDB::register_class<LimboUtility>();
|
|
|
|
Engine::get_singleton()->add_singleton(Engine::Singleton("LimboUtility", LimboUtility::get_singleton()));
|
|
|
|
|
2022-09-01 22:20:37 +00:00
|
|
|
#ifdef TOOLS_ENABLED
|
|
|
|
EditorPlugins::add_by_type<LimboAIEditorPlugin>();
|
|
|
|
#endif
|
|
|
|
|
2022-08-28 10:54:34 +00:00
|
|
|
LimboStringNames::create();
|
|
|
|
}
|
|
|
|
|
|
|
|
void unregister_limboai_types() {
|
|
|
|
LimboStringNames::free();
|
2022-09-21 21:56:04 +00:00
|
|
|
|
|
|
|
memdelete(_limbo_utility);
|
2022-08-28 10:54:34 +00:00
|
|
|
}
|