afegit defaults.h amb els valors per defecte de Param

This commit is contained in:
2025-08-16 10:29:30 +02:00
parent 0c10898bdc
commit 81d486f2d3
6 changed files with 316 additions and 231 deletions

View File

@@ -16,6 +16,15 @@ class Texture;
// --- Clase Notifier: gestiona las notificaciones en pantalla (singleton) ---
class Notifier {
public:
// Posiciones de las notificaciones
enum class Position {
TOP,
BOTTOM,
LEFT,
MIDDLE,
RIGHT,
};
// --- Métodos de singleton ---
static void init(const std::string &icon_file, std::shared_ptr<Text> text); // Inicializa el singleton
static void destroy(); // Libera el singleton
@@ -33,30 +42,30 @@ class Notifier {
private:
// --- Tipos internos ---
enum class NotificationStatus {
enum class State {
RISING,
STAY,
VANISHING,
FINISHED,
};
enum class NotificationShape {
enum class Shape {
ROUNDED,
SQUARED,
};
// --- Estructura Notification ---
struct Notification {
std::shared_ptr<Texture> texture; // Textura de la notificación
std::shared_ptr<Sprite> sprite; // Sprite asociado
std::vector<std::string> texts; // Textos a mostrar
int counter{0}; // Contador de tiempo
NotificationStatus state{NotificationStatus::RISING}; // Estado de la notificación
NotificationShape shape{NotificationShape::SQUARED}; // Forma de la notificación
SDL_FRect rect; // Rectángulo de la notificación
int y{0}; // Posición vertical
int travel_dist{0}; // Distancia a recorrer
std::string code; // Código identificador de la notificación
std::shared_ptr<Texture> texture; // Textura de la notificación
std::shared_ptr<Sprite> sprite; // Sprite asociado
std::vector<std::string> texts; // Textos a mostrar
int counter{0}; // Contador de tiempo
State state{State::RISING}; // Estado de la notificación
Shape shape{Shape::SQUARED}; // Forma de la notificación
SDL_FRect rect; // Rectángulo de la notificación
int y{0}; // Posición vertical
int travel_dist{0}; // Distancia a recorrer
std::string code; // Código identificador de la notificación
// Constructor
explicit Notification()