2024-03-13 15:08:37 +00:00
|
|
|
#include "game_mode.hpp"
|
|
|
|
#include <godot_cpp/classes/global_constants.hpp>
|
|
|
|
#include <godot_cpp/classes/packed_scene.hpp>
|
|
|
|
#include <godot_cpp/classes/scene_state.hpp>
|
|
|
|
#include "utils/godot_macros.h"
|
|
|
|
#include "game_state.hpp"
|
|
|
|
|
|
|
|
namespace godot {
|
|
|
|
void GameMode::_bind_methods() {
|
|
|
|
#define CLASSNAME GameMode
|
|
|
|
GDPROPERTY_HINTED(game_state, Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, "GameState");
|
|
|
|
GDPROPERTY_HINTED(player_scene, Variant::OBJECT, PROPERTY_HINT_RESOURCE_TYPE, "PackedScene");
|
|
|
|
}
|
|
|
|
|
2024-03-21 21:49:11 +00:00
|
|
|
void GameMode::_begin() {}
|
|
|
|
void GameMode::_end() {}
|
|
|
|
|
2024-03-13 15:08:37 +00:00
|
|
|
void GameMode::set_player_scene(Ref<PackedScene> scene) {
|
|
|
|
this->player_scene = scene;
|
|
|
|
}
|
|
|
|
|
|
|
|
Ref<PackedScene> GameMode::get_player_scene() const {
|
|
|
|
return this->player_scene;
|
|
|
|
}
|
|
|
|
|
|
|
|
void GameMode::set_game_state(Ref<GameState> state) {
|
|
|
|
if(state.is_null() || !state.is_valid()) {
|
|
|
|
this->game_state.unref();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
this->game_state = state;
|
|
|
|
}
|
|
|
|
|
|
|
|
Ref<GameState> GameMode::get_game_state() {
|
|
|
|
return this->game_state;
|
|
|
|
}
|
|
|
|
}
|