Singletonejant

Borrat menu.cpp que no estava gastantse...mmm.. desde mai
This commit is contained in:
2025-02-22 18:27:23 +01:00
parent e361d295c1
commit fc01676df2
38 changed files with 440 additions and 1751 deletions

View File

@@ -44,6 +44,9 @@ struct res_room_t
class Resource
{
private:
// [SINGLETON] Objeto privado
static Resource *resource_;
// Variables
std::vector<res_texture_t> textures_;
std::vector<res_animation_t> animations_;
@@ -51,13 +54,22 @@ private:
std::vector<res_tileMap_t> tile_maps_;
std::vector<res_room_t> rooms_;
public:
// Constructor
Resource() = default;
// Destructor
~Resource() = default;
public:
// [SINGLETON] Crearemos el objeto con esta función estática
static void init();
// [SINGLETON] Destruiremos el objeto con esta función estática
static void destroy();
// [SINGLETON] Con este método obtenemos el objeto y podemos trabajar con él
static Resource *get();
// Carga las texturas de una lista
void loadTextures(std::vector<std::string> list);