Eliminada la classe Lang

This commit is contained in:
2024-09-26 18:08:59 +02:00
parent 6ad1bca29f
commit 69027f96e6
16 changed files with 94 additions and 158 deletions

View File

@@ -1,35 +1,17 @@
#pragma once
#include <SDL2/SDL.h>
#include "common/asset.h"
#include <string>
#include <vector>
// Códigos de idioma
#define es_ES 0
#define ba_BA 1
#define en_UK 2
#define MAX_LANGUAGES 3
// Textos
#define MAX_TEXT_STRINGS 100
// Clase Lang
class Lang
namespace lang
{
private:
Asset *mAsset; // Objeto que gestiona todos los ficheros de recursos
std::string mTextStrings[MAX_TEXT_STRINGS]; // Vector con los textos
public:
// Constructor
Lang(Asset *mAsset);
// Destructor
~Lang();
// Variables
std::vector<std::string> texts; // Vector con los textos
// Inicializa los textos del juego en el idioma seleccionado
bool setLang(Uint8 lang);
bool loadFromFile(std::string filePath);
// Obtiene la cadena de texto del indice
std::string getText(int index);
};
}