corregida la llista de inicialització en clang-format

creat Balloon::Config per a inicialitzar globos
This commit is contained in:
2025-08-24 17:16:49 +02:00
parent fe950e6f17
commit 928335576c
61 changed files with 964 additions and 733 deletions

View File

@@ -45,8 +45,8 @@ void EnterName::incPosition() {
} else if (position_ > 0) // No es necesario verificar position_ < MAX_NAME_LENGTH
{
// Copiamos el índice del carácter anterior si es posible.
//character_index_[position_] = character_index_[position_ - 1];
// character_index_[position_] = character_index_[position_ - 1];
// Ponemos el caracter "espacio"
character_index_[position_] = 0;
} else {
@@ -147,12 +147,19 @@ auto EnterName::findIndex(char character) const -> int {
// Devuelve un nombre al azar
auto EnterName::getRandomName() -> std::string {
static constexpr std::array<std::string_view, 8> NAMES = {
"BAL1", "TABE", "DOC", "MON", "SAM1", "JORDI", "JDES", "PEPE"};
"BAL1",
"TABE",
"DOC",
"MON",
"SAM1",
"JORDI",
"JDES",
"PEPE"};
return std::string(NAMES[rand() % NAMES.size()]);
}
// Obtiene el nombre final introducido
auto EnterName::getFinalName() -> std::string {
auto name = trim(name_.substr(0, position_ + 1)); // Devuelve el texto intruducido incluyendo el del selector
auto name = trim(name_.substr(0, position_ + 1)); // Devuelve el texto intruducido incluyendo el del selector
if (name.empty()) {
name = getRandomName();
}