2022-08-28 10:54:34 +00:00
|
|
|
/* register_types.cpp */
|
|
|
|
|
|
|
|
#include "register_types.h"
|
|
|
|
|
2022-12-15 07:26:52 +00:00
|
|
|
#include "core/object/class_db.h"
|
2022-08-28 10:54:34 +00:00
|
|
|
|
2022-10-20 16:26:46 +00:00
|
|
|
#include "bb_param/bb_aabb.h"
|
|
|
|
#include "bb_param/bb_array.h"
|
|
|
|
#include "bb_param/bb_basis.h"
|
|
|
|
#include "bb_param/bb_bool.h"
|
|
|
|
#include "bb_param/bb_byte_array.h"
|
|
|
|
#include "bb_param/bb_color.h"
|
|
|
|
#include "bb_param/bb_color_array.h"
|
|
|
|
#include "bb_param/bb_dictionary.h"
|
|
|
|
#include "bb_param/bb_float.h"
|
|
|
|
#include "bb_param/bb_int.h"
|
|
|
|
#include "bb_param/bb_int_array.h"
|
2022-10-20 20:00:10 +00:00
|
|
|
#include "bb_param/bb_node.h"
|
2022-10-20 16:26:46 +00:00
|
|
|
#include "bb_param/bb_param.h"
|
|
|
|
#include "bb_param/bb_plane.h"
|
|
|
|
#include "bb_param/bb_quat.h"
|
|
|
|
#include "bb_param/bb_real_array.h"
|
|
|
|
#include "bb_param/bb_rect2.h"
|
|
|
|
#include "bb_param/bb_string.h"
|
|
|
|
#include "bb_param/bb_string_array.h"
|
|
|
|
#include "bb_param/bb_transform.h"
|
|
|
|
#include "bb_param/bb_transform2d.h"
|
2022-10-25 20:01:00 +00:00
|
|
|
#include "bb_param/bb_variant.h"
|
2022-10-20 16:26:46 +00:00
|
|
|
#include "bb_param/bb_vector2.h"
|
|
|
|
#include "bb_param/bb_vector2_array.h"
|
|
|
|
#include "bb_param/bb_vector3.h"
|
|
|
|
#include "bb_param/bb_vector3_array.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-10-19 18:54:21 +00:00
|
|
|
#include "bt/bt_state.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-12-15 07:26:52 +00:00
|
|
|
#include "core/string/print_string.h"
|
2022-09-29 10:54:07 +00:00
|
|
|
#include "limbo_hsm.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-12-15 07:26:52 +00:00
|
|
|
void initialize_limboai_module(ModuleInitializationLevel p_level) {
|
|
|
|
if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) {
|
|
|
|
ClassDB::register_class<Blackboard>();
|
|
|
|
|
|
|
|
ClassDB::register_class<LimboState>();
|
|
|
|
ClassDB::register_class<LimboHSM>();
|
|
|
|
|
|
|
|
ClassDB::register_class<BTTask>();
|
|
|
|
ClassDB::register_class<BehaviorTree>();
|
|
|
|
ClassDB::register_class<BTPlayer>();
|
|
|
|
ClassDB::register_class<BTState>();
|
|
|
|
|
|
|
|
ClassDB::register_class<BTComposite>();
|
|
|
|
ClassDB::register_class<BTSequence>();
|
|
|
|
ClassDB::register_class<BTDynamicSequence>();
|
|
|
|
ClassDB::register_class<BTDynamicSelector>();
|
|
|
|
ClassDB::register_class<BTSelector>();
|
|
|
|
ClassDB::register_class<BTRandomSelector>();
|
|
|
|
ClassDB::register_class<BTRandomSequence>();
|
|
|
|
ClassDB::register_class<BTSelector>();
|
|
|
|
ClassDB::register_class<BTParallel>();
|
|
|
|
|
|
|
|
ClassDB::register_class<BTDecorator>();
|
|
|
|
ClassDB::register_class<BTInvert>();
|
|
|
|
ClassDB::register_class<BTAlwaysFail>();
|
|
|
|
ClassDB::register_class<BTAlwaysSucceed>();
|
|
|
|
ClassDB::register_class<BTDelay>();
|
|
|
|
ClassDB::register_class<BTRepeat>();
|
|
|
|
ClassDB::register_class<BTRepeatUntilFailure>();
|
|
|
|
ClassDB::register_class<BTRepeatUntilSuccess>();
|
|
|
|
ClassDB::register_class<BTRunLimit>();
|
|
|
|
ClassDB::register_class<BTTimeLimit>();
|
|
|
|
ClassDB::register_class<BTCooldown>();
|
|
|
|
ClassDB::register_class<BTProbability>();
|
|
|
|
ClassDB::register_class<BTForEach>();
|
|
|
|
|
|
|
|
ClassDB::register_class<BTAction>();
|
|
|
|
ClassDB::register_class<BTFail>();
|
|
|
|
ClassDB::register_class<BTWait>();
|
|
|
|
ClassDB::register_class<BTRandomWait>();
|
|
|
|
ClassDB::register_class<BTWaitTicks>();
|
|
|
|
ClassDB::register_class<BTNewScope>();
|
|
|
|
ClassDB::register_class<BTSubtree>();
|
|
|
|
ClassDB::register_class<BTConsolePrint>();
|
|
|
|
|
|
|
|
ClassDB::register_class<BTCondition>();
|
|
|
|
|
|
|
|
ClassDB::register_abstract_class<BBParam>();
|
|
|
|
ClassDB::register_class<BBInt>();
|
|
|
|
ClassDB::register_class<BBBool>();
|
|
|
|
ClassDB::register_class<BBFloat>();
|
|
|
|
ClassDB::register_class<BBString>();
|
|
|
|
ClassDB::register_class<BBVector2>();
|
|
|
|
ClassDB::register_class<BBRect2>();
|
|
|
|
ClassDB::register_class<BBVector3>();
|
|
|
|
ClassDB::register_class<BBTransform2D>();
|
|
|
|
ClassDB::register_class<BBPlane>();
|
|
|
|
ClassDB::register_class<BBQuat>();
|
|
|
|
ClassDB::register_class<BBAabb>();
|
|
|
|
ClassDB::register_class<BBBasis>();
|
|
|
|
ClassDB::register_class<BBTransform>();
|
|
|
|
ClassDB::register_class<BBColor>();
|
|
|
|
ClassDB::register_class<BBNode>();
|
|
|
|
ClassDB::register_class<BBDictionary>();
|
|
|
|
ClassDB::register_class<BBArray>();
|
|
|
|
ClassDB::register_class<BBByteArray>();
|
|
|
|
ClassDB::register_class<BBIntArray>();
|
|
|
|
ClassDB::register_class<BBRealArray>();
|
|
|
|
ClassDB::register_class<BBColorArray>();
|
|
|
|
ClassDB::register_class<BBStringArray>();
|
|
|
|
ClassDB::register_class<BBVector2Array>();
|
|
|
|
ClassDB::register_class<BBVector3Array>();
|
|
|
|
ClassDB::register_class<BBVariant>();
|
|
|
|
|
|
|
|
_limbo_utility = memnew(LimboUtility);
|
|
|
|
ClassDB::register_class<LimboUtility>();
|
|
|
|
|
|
|
|
LimboStringNames::create();
|
|
|
|
}
|
2022-09-21 21:56:04 +00:00
|
|
|
|
2022-09-01 22:20:37 +00:00
|
|
|
#ifdef TOOLS_ENABLED
|
2022-12-15 07:26:52 +00:00
|
|
|
if (p_level == MODULE_INITIALIZATION_LEVEL_EDITOR) {
|
|
|
|
Engine::get_singleton()->add_singleton(Engine::Singleton("LimboUtility", LimboUtility::get_singleton()));
|
|
|
|
EditorPlugins::add_by_type<LimboAIEditorPlugin>();
|
|
|
|
}
|
2022-09-01 22:20:37 +00:00
|
|
|
#endif
|
2022-08-28 10:54:34 +00:00
|
|
|
}
|
|
|
|
|
2022-12-15 07:26:52 +00:00
|
|
|
void uninitialize_limboai_module(ModuleInitializationLevel p_level) {
|
|
|
|
if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) {
|
|
|
|
LimboStringNames::free();
|
|
|
|
memdelete(_limbo_utility);
|
|
|
|
}
|
2022-08-28 10:54:34 +00:00
|
|
|
}
|