Primer commit. Clon del repo de CC

This commit is contained in:
2024-05-08 16:54:45 +02:00
parent 323dc7b165
commit 889b571dac
251 changed files with 85336 additions and 88 deletions

39
source/lang.h Normal file
View File

@@ -0,0 +1,39 @@
#pragma once
#include <SDL2/SDL.h>
#include "common/asset.h"
#include <string>
#ifndef LANG_H
#define LANG_H
// 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
{
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();
// Inicializa los textos del juego en el idioma seleccionado
bool setLang(Uint8 lang);
// Obtiene la cadena de texto del indice
std::string getText(int index);
};
#endif