2024-05-29 21:05:39 +00:00
|
|
|
#ifndef UTILS_GAME_MODE_HPP
|
|
|
|
#define UTILS_GAME_MODE_HPP
|
2024-03-13 15:08:37 +00:00
|
|
|
|
2024-05-30 13:07:17 +00:00
|
|
|
#include <godot_cpp/classes/node.hpp>
|
2024-03-13 15:08:37 +00:00
|
|
|
#include <godot_cpp/classes/packed_scene.hpp>
|
|
|
|
|
2024-05-28 14:28:36 +00:00
|
|
|
namespace gd = godot;
|
|
|
|
|
|
|
|
namespace utils {
|
2024-05-29 15:36:17 +00:00
|
|
|
/*! Stores session-relevant data.
|
|
|
|
*
|
2024-05-30 13:07:17 +00:00
|
|
|
* Inheriting classes are intended to keep only data that is relevant for the duration of the current session/match. Use GameState instead if you want data to be saved between sessions.
|
2024-05-29 15:36:17 +00:00
|
|
|
* Will be destroyed when a level is loaded that does not match the same game mode class.
|
2024-05-30 13:42:53 +00:00
|
|
|
* The current active game mode can be gotten from the GameRoot3D singleton instance.
|
2024-05-29 15:36:17 +00:00
|
|
|
*/
|
2024-05-30 13:07:17 +00:00
|
|
|
class GameMode : public gd::Node {
|
|
|
|
GDCLASS(GameMode, gd::Node);
|
2024-03-13 15:08:37 +00:00
|
|
|
static void _bind_methods();
|
|
|
|
public:
|
2024-05-28 14:28:36 +00:00
|
|
|
void set_player_scene(gd::Ref<gd::PackedScene> scene);
|
|
|
|
gd::Ref<gd::PackedScene> get_player_scene() const;
|
2024-03-13 15:08:37 +00:00
|
|
|
private:
|
2024-05-29 15:36:17 +00:00
|
|
|
gd::Ref<gd::PackedScene> player_scene{}; //!< The scene to instantiate when spawning a player.
|
2024-03-13 15:08:37 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2024-05-29 21:05:39 +00:00
|
|
|
#endif // !UTILS_GAME_MODE_HPP
|