fix: el nom apareixia duplicat en la tabla de records

This commit is contained in:
2025-08-10 20:36:13 +02:00
parent 0fc709f6d5
commit 659a4ced44
4 changed files with 23 additions and 22 deletions

View File

@@ -186,9 +186,6 @@ class Player {
[[nodiscard]] auto getGamepad() const -> std::shared_ptr<Input::Gamepad> { return gamepad_; }
void setUsesKeyboard(bool value) { uses_keyboard_ = value; }
[[nodiscard]] auto getUsesKeyboard() const -> bool { return uses_keyboard_; }
void setHiScoreTable(const Table &table) { hi_score_table_ = table; }
[[nodiscard]] auto getHiScoreTable() const -> const Table & { return hi_score_table_; }
void setGlowingEntry(const int &entry) { glowing_entry_ = entry; }
private:
// --- Constantes ---
@@ -204,8 +201,8 @@ class Player {
std::unique_ptr<AnimatedSprite> power_sprite_; // Sprite para dibujar el aura del jugador con el poder a tope
std::unique_ptr<EnterName> enter_name_; // Clase utilizada para introducir el nombre
std::shared_ptr<Input::Gamepad> gamepad_ = nullptr; // Dispositivo asociado
Table &hi_score_table_; // Tabla de máximas puntuaciones
int &glowing_entry_; // Entrada de la tabla de puntuaciones para hacerla brillar
Table *hi_score_table_ = nullptr; // Tabla de máximas puntuaciones
int *glowing_entry_ = nullptr; // Entrada de la tabla de puntuaciones para hacerla brillar
std::string name_; // Nombre del jugador
std::string last_enter_name_; // Último nombre introducido en la tabla de puntuaciones