2024-05-29 21:05:39 +00:00
|
|
|
#ifndef UTILS_LEVEL_HPP
|
|
|
|
#define UTILS_LEVEL_HPP
|
2024-03-13 15:08:37 +00:00
|
|
|
|
|
|
|
#include "game_mode.hpp"
|
2024-05-28 14:28:36 +00:00
|
|
|
#include <godot_cpp/classes/node3d.hpp>
|
2024-03-13 15:08:37 +00:00
|
|
|
|
2024-05-28 14:28:36 +00:00
|
|
|
namespace gd = godot;
|
2024-03-13 15:08:37 +00:00
|
|
|
|
2024-05-28 14:28:36 +00:00
|
|
|
namespace utils {
|
2024-05-29 15:36:44 +00:00
|
|
|
/*! 3D level root to be used with GameRoot3D.
|
|
|
|
*
|
|
|
|
* The configured game mode will become the active GameMode in GameRoot3D if one does not exist yet.
|
|
|
|
*/
|
2024-05-28 14:28:36 +00:00
|
|
|
class Level3D : public gd::Node3D {
|
|
|
|
GDCLASS(Level3D, gd::Node3D);
|
2024-03-13 15:08:37 +00:00
|
|
|
static void _bind_methods();
|
|
|
|
public:
|
2024-05-30 13:07:17 +00:00
|
|
|
void set_game_mode_prototype(gd::Ref<gd::PackedScene> prototype);
|
|
|
|
gd::Ref<gd::PackedScene> get_game_mode_prototype() const;
|
2024-03-13 15:08:37 +00:00
|
|
|
private:
|
2024-05-30 13:07:17 +00:00
|
|
|
gd::Ref<gd::PackedScene> game_mode_prototype{}; //!< The starting state of the game mode to instantiate if this is the "leading" level.
|
2024-03-13 15:08:37 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2024-05-29 21:05:39 +00:00
|
|
|
#endif // !UTILS_LEVEL_HPP
|