claude: arreglos d'estil

This commit is contained in:
2025-08-16 19:48:32 +02:00
parent 1ced698093
commit ada5025c65
62 changed files with 903 additions and 1102 deletions

View File

@@ -14,7 +14,7 @@
// Declaración adelantada
class Texture;
// Estructura de Animación
// --- Estructuras ---
struct Animation {
static constexpr int DEFAULT_SPEED = 5;
@@ -37,13 +37,13 @@ struct AnimationConfig {
int max_tiles = 1;
};
// Alias de tipo para buffer de animaciones
using AnimationsFileBuffer = std::vector<std::string>;
// --- Tipos ---
using AnimationsFileBuffer = std::vector<std::string>; // Buffer de animaciones
// Carga las animaciones desde un fichero en un vector de strings
auto loadAnimationsFromFile(const std::string& file_path) -> AnimationsFileBuffer;
// --- Funciones ---
auto loadAnimationsFromFile(const std::string& file_path) -> AnimationsFileBuffer; // Carga las animaciones desde un fichero
// Clase AnimatedSprite: Sprite animado que hereda de MovingSprite
// --- Clase AnimatedSprite: sprite animado que hereda de MovingSprite ---
class AnimatedSprite : public MovingSprite {
public:
// --- Constructores y destructor ---
@@ -70,12 +70,10 @@ class AnimatedSprite : public MovingSprite {
auto getAnimationIndex(const std::string& name) -> int; // Obtiene el índice de una animación por nombre
protected:
// --- Datos de animación ---
std::vector<Animation> animations_; // Vector de animaciones disponibles
int current_animation_ = 0; // Índice de la animación activa
// --- Mapa para búsqueda rápida de animaciones por nombre ---
std::unordered_map<std::string, int> animation_indices_;
// --- Variables de estado ---
std::vector<Animation> animations_; // Vector de animaciones disponibles
std::unordered_map<std::string, int> animation_indices_; // Mapa para búsqueda rápida por nombre
int current_animation_ = 0; // Índice de la animación activa
// --- Métodos internos ---
void animate(); // Calcula el frame correspondiente a la animación