From 03dbdd723d3d82b1560549d0b72a8151150fb252 Mon Sep 17 00:00:00 2001 From: Maxiwere45 Date: Tue, 9 Jun 2026 10:49:51 +0200 Subject: [PATCH] feat(core): add centralized app constants Co-Authored-By: Claude Opus 4.8 --- lib/core/config/app_constants.dart | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 lib/core/config/app_constants.dart diff --git a/lib/core/config/app_constants.dart b/lib/core/config/app_constants.dart new file mode 100644 index 0000000..d5e3542 --- /dev/null +++ b/lib/core/config/app_constants.dart @@ -0,0 +1,40 @@ +/// Constantes globales de l'application, centralisées pour éviter les valeurs en dur. +class AppConstants { + AppConstants._(); + + /// Nombre total de Pokémon gérés (jusqu'à la Gen 9). + static const int totalPokemon = 1025; + + /// Points gagnés pour une bonne réponse normale. + static const int pointsNormal = 10; + + /// Points gagnés pour une bonne réponse sur un Pokémon shiny. + static const int pointsShiny = 20; + + /// Nombre de vies au début d'une partie. + static const int startingLives = 3; + + /// Nombre de skips au début d'une partie. + static const int startingSkips = 3; + + /// Nombre d'indices au début d'une partie. + static const int startingHints = 3; + + /// Une bonne réponse tous les N donne un indice bonus. + static const int hintBonusEvery = 5; + + /// Une bonne réponse tous les N donne un skip bonus. + static const int skipBonusEvery = 10; + + /// Probabilité d'apparition d'un shiny : 1 chance sur N. + static const int shinyOdds = 10; + + /// Hôte de l'API Tyradex. + static const String apiBaseUrl = 'tyradex.app'; + + /// Chemin de l'endpoint Pokémon. + static const String apiPokemonPath = 'api/v1/pokemon'; + + /// Clé SharedPreferences pour le meilleur score. + static const String prefsBestScore = 'best_score'; +}