feat: initialized template
This commit is contained in:
parent
fdb9ad8de0
commit
37b3a63ae6
12 changed files with 48 additions and 31 deletions
|
|
@ -1,15 +0,0 @@
|
|||
#include "register_types.h"
|
||||
|
||||
#include "core/object/class_db.h"
|
||||
|
||||
void initialize_PROJECT_module(ModuleInitializationLevel p_level) {
|
||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void uninitialize_PROJECT_module(ModuleInitializationLevel p_level) {
|
||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef PROJECT_REGISTER_TYPES_H
|
||||
#define PROJECT_REGISTER_TYPES_H
|
||||
|
||||
#include "modules/register_module_types.h"
|
||||
|
||||
void initialize_PROJECT_module(ModuleInitializationLevel p_level);
|
||||
void uninitialize_PROJECT_module(ModuleInitializationLevel p_level);
|
||||
|
||||
#endif // !PROJECT_REGISTER_TYPES_H
|
||||
BIN
modules/authority/__pycache__/config.cpython-313.pyc
Normal file
BIN
modules/authority/__pycache__/config.cpython-313.pyc
Normal file
Binary file not shown.
26
modules/authority/register_types.cpp
Normal file
26
modules/authority/register_types.cpp
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include "register_types.h"
|
||||
|
||||
#include "authority/game_state.h"
|
||||
#include "core/config/engine.h"
|
||||
#include "core/object/class_db.h"
|
||||
|
||||
GameState *game_state{nullptr};
|
||||
|
||||
void initialize_authority_module(ModuleInitializationLevel p_level) {
|
||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||
return;
|
||||
}
|
||||
GDREGISTER_CLASS(GameState);
|
||||
|
||||
game_state = memnew(GameState);
|
||||
Engine::get_singleton()->add_singleton(Engine::Singleton("GameState", GameState::get_singleton()));
|
||||
}
|
||||
|
||||
void uninitialize_authority_module(ModuleInitializationLevel p_level) {
|
||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||
return;
|
||||
}
|
||||
if(game_state) {
|
||||
memdelete(game_state);
|
||||
}
|
||||
}
|
||||
9
modules/authority/register_types.h
Normal file
9
modules/authority/register_types.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef authority_REGISTER_TYPES_H
|
||||
#define authority_REGISTER_TYPES_H
|
||||
|
||||
#include "modules/register_module_types.h"
|
||||
|
||||
void initialize_authority_module(ModuleInitializationLevel p_level);
|
||||
void uninitialize_authority_module(ModuleInitializationLevel p_level);
|
||||
|
||||
#endif // !authority_REGISTER_TYPES_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue