singletons
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user