godot-cpp-utils
A collection of utility classes, functions and macros for use with Godot and GDExtension.
Loading...
Searching...
No Matches
game_mode.hpp
1#ifndef GAME_MODE_HPP
2#define GAME_MODE_HPP
3
4#include <godot_cpp/classes/packed_scene.hpp>
5#include <godot_cpp/classes/resource.hpp>
6
7namespace gd = godot;
8
9namespace utils {
15class GameMode : public gd::Resource {
16 GDCLASS(GameMode, gd::Resource);
17 static void _bind_methods();
18public:
19 virtual void _begin();
20 virtual void _end();
21
22 void set_player_scene(gd::Ref<gd::PackedScene> scene);
23 gd::Ref<gd::PackedScene> get_player_scene() const;
24private:
25 gd::Ref<gd::PackedScene> player_scene{};
26};
27}
28
29#endif // !GAME_MODE_HPP
Stores session-relevant data.
Definition game_mode.hpp:15
gd::Ref< gd::PackedScene > player_scene
The scene to instantiate when spawning a player.
Definition game_mode.hpp:25
virtual void _begin()
Called when the match begins.
Definition game_mode.cpp:13
virtual void _end()
Called when the match is ending.
Definition game_mode.cpp:14