#pragma once #include // for SDL_FRect #include // for shared_ptr, unique_ptr #include "defines.h" // for Color #include "external/sprite.h" // for Sprite class Texture; class Ball { private: std::unique_ptr sprite_; // Sprite para pintar la clase SDL_FRect pos_; // Posición y tamaño de la pelota float vx_, vy_; // Velocidad float gravity_force_; // Gravedad GravityDirection gravity_direction_; // Direcci\u00f3n de la gravedad Color color_; // Color de la pelota bool on_surface_; // Indica si la pelota est\u00e1 en la superficie (suelo/techo/pared) bool stopped_; // Indica si la pelota ha terminado de moverse; float loss_; // Coeficiente de rebote. Pérdida de energía en cada rebote public: // Constructor Ball(float x, float vx, float vy, Color color, std::shared_ptr texture, GravityDirection gravity_dir = GravityDirection::DOWN); // Destructor ~Ball() = default; // Actualiza la lógica de la clase void update(float deltaTime); // Pinta la clase void render(); // Modifica la velocidad void modVel(float vx, float vy); // Cambia la gravedad void switchGravity(); // Cambia la direcci\u00f3n de gravedad void setGravityDirection(GravityDirection direction); // Getters para debug float getVelocityY() const { return vy_; } float getVelocityX() const { return vx_; } float getGravityForce() const { return gravity_force_; } GravityDirection getGravityDirection() const { return gravity_direction_; } bool isOnSurface() const { return on_surface_; } // Getters para batch rendering SDL_FRect getPosition() const { return pos_; } Color getColor() const { return color_; } };