singletons

This commit is contained in:
2026-04-17 21:27:30 +02:00
parent 5889df2a47
commit 513eacf356
27 changed files with 536 additions and 505 deletions

View File

@@ -39,10 +39,18 @@ class Asset {
// Devuelve el nombre del tipo de recurso
std::string getTypeName(int type);
public:
// Constructor
// Constructor privado (usar Asset::init)
Asset(std::string path);
// Instancia única
static Asset *instance;
public:
// Singleton API
static void init(const std::string &executablePath); // Crea la instancia
static void destroy(); // Libera la instancia
static auto get() -> Asset *; // Obtiene el puntero a la instancia
// Añade un elemento a la lista
void add(std::string file, enum assetType type, bool required = true, bool absolute = false);