Estandaritzant noms segons convencions

This commit is contained in:
2024-10-10 20:27:31 +02:00
parent 9e5f41644e
commit d6c3c89872
67 changed files with 1457 additions and 1504 deletions

View File

@@ -3,18 +3,18 @@
#include <string> // for string, basic_string
#include <vector> // for vector
enum assetType
enum class AssetType
{
t_bitmap,
t_music,
t_sound,
t_font,
t_lang,
t_data,
t_animation,
t_palette,
t_item,
t_maxAssetType
BITMAP,
MUSIC,
SOUND,
FONT,
LANG,
DATA,
ANIMATION,
PALETTE,
ITEM,
MAX_ASSET_TYPE,
};
// Clase Asset
@@ -25,25 +25,24 @@ private:
static Asset *asset;
// Estructura para definir un item
struct item_t
struct AssetItem
{
std::string file; // Ruta del fichero desde la raiz del directorio
enum assetType type; // Indica el tipo de recurso
enum AssetType type; // Indica el tipo de recurso
bool required; // Indica si es un fichero que debe de existir
// bool absolute; // Indica si la ruta que se ha proporcionado es una ruta absoluta
};
// Variables
int longestName; // Contiene la longitud del nombre de fichero mas largo
std::vector<item_t> fileList; // Listado con todas las rutas a los ficheros
std::string executablePath; // Ruta al ejecutable
bool verbose; // Indica si ha de mostrar información por pantalla
int longest_name_; // Contiene la longitud del nombre de fichero mas largo
std::vector<AssetItem> file_list_; // Listado con todas las rutas a los ficheros
std::string executable_path_; // Ruta al ejecutable
// Comprueba que existe un fichero
bool checkFile(std::string executablePath);
bool checkFile(std::string executable_path) const;
// Devuelve el nombre del tipo de recurso
std::string getTypeName(int type);
std::string getTypeName(int type) const;
// Constructor
Asset(std::string path);
@@ -62,17 +61,14 @@ public:
static Asset *get();
// Añade un elemento a la lista
void add(std::string file, enum assetType type, bool required = true, bool absolute = false);
void add(std::string file, AssetType type, bool required = true, bool absolute = false);
// Devuelve un elemento de la lista a partir de una cadena
std::string get(std::string text);
std::string get(std::string text) const;
// Comprueba que existen todos los elementos
bool check();
// Establece si ha de mostrar texto por pantalla
void setVerbose(bool value);
bool check() const;
// Devuelve la lista de recursos de un tipo
std::vector<std::string> getListByType(assetType type);
std::vector<std::string> getListByType(AssetType type) const;
};