claude: arreglos d'estil
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user