2024-03-13 15:08:37 +00:00
|
|
|
#include "level.hpp"
|
2024-05-30 13:07:17 +00:00
|
|
|
#include "godot_cpp/core/class_db.hpp"
|
2024-05-29 22:49:37 +00:00
|
|
|
#include "utils/godot_macros.hpp"
|
2024-05-30 13:07:17 +00:00
|
|
|
#include <godot_cpp/classes/scene_state.hpp>
|
2024-03-13 15:08:37 +00:00
|
|
|
|
2024-05-28 14:28:36 +00:00
|
|
|
namespace utils {
|
2024-03-13 15:08:37 +00:00
|
|
|
void Level3D::_bind_methods() {
|
|
|
|
#define CLASSNAME Level3D
|
2024-05-30 13:07:17 +00:00
|
|
|
GDPROPERTY_HINTED(game_mode_prototype, gd::Variant::OBJECT, gd::PROPERTY_HINT_RESOURCE_TYPE, "PackedScene");
|
2024-03-13 15:08:37 +00:00
|
|
|
}
|
|
|
|
|
2024-05-30 13:07:17 +00:00
|
|
|
void Level3D::set_game_mode_prototype(gd::Ref<gd::PackedScene> prototype) {
|
|
|
|
if(prototype.is_null() || !prototype.is_valid())
|
|
|
|
this->game_mode_prototype = gd::Ref<gd::PackedScene>(nullptr);
|
|
|
|
else if(!gd::ClassDB::is_parent_class(prototype->get_state()->get_node_type(0), "GameMode"))
|
|
|
|
return;
|
|
|
|
else
|
|
|
|
this->game_mode_prototype = prototype;
|
2024-03-13 15:08:37 +00:00
|
|
|
}
|
|
|
|
|
2024-05-30 13:07:17 +00:00
|
|
|
gd::Ref<gd::PackedScene> Level3D::get_game_mode_prototype() const {
|
2024-03-13 15:08:37 +00:00
|
|
|
return this->game_mode_prototype;
|
|
|
|
}
|
|
|
|
}
|