Я пересоздал репозиторий из-за большого количества мусора в прошлом

This commit is contained in:
Jiga228
2025-09-14 15:00:44 +07:00
commit 78a25b305b
74 changed files with 3428 additions and 0 deletions
+60
View File
@@ -0,0 +1,60 @@
#pragma once
#include <string>
#include <list>
#include <vector>
#include "Game/GameInstance.h"
class CoreInstance {
struct Module {
const char* name;
void* handler;
};
#pragma region Key words for main config
const char* key_base_world= "base_world";
const char* key_modules = "modules";
#pragma endregion
#pragma region config parameters
const char* main_config = "main_config.conf";
std::string base_world;
std::vector<std::string> modules_names;
#pragma endregion
int countCPU;
unsigned long long memorySize;
std::list<Module> modules;
GameInstance* game = nullptr;
public:
CoreInstance();
~CoreInstance();
void start();
int getCountCPU() const { return countCPU; }
unsigned long long getMemorySize() const { return memorySize; }
/**
* @throws std::runtime_error if module isn't enabled
* @throws std::runtime_error if module not found
* @return module handler
*/
void* getHandlerModule(const char* name) const noexcept(false);
/**
* @throws std::runtime_error if the module already enabled
* @throws std::runtime_error if the module isn't found
* @throws std::runtime_error if the module doesn't contain InitModule or StartModule
* @retuen module handler
*/
void* enableModule(const char* name) noexcept(false);
/**
* @throws std::runtime_error if the module isn't found
* @throws std::runtime_error module isn't contain QuitModule function
*/
void disableModule(const char* name) noexcept(false);
const std::string& getBaseWorldName() const { return base_world; }
};