#pragma once #include #include // Para string #include // Para vector // Clase Debug class Debug { public: // [SINGLETON] Crearemos el objeto con esta función estática static void init(); // [SINGLETON] Destruiremos el objeto con esta función estática static void destroy(); // [SINGLETON] Con este método obtenemos el objeto y podemos trabajar con él static auto get() -> Debug*; // Dibuja en pantalla void render(); // Establece la posición donde se colocará la información de debug void setPos(SDL_FPoint p); // Getters [[nodiscard]] auto getEnabled() const -> bool { return enabled_; } // Setters void add(const std::string& text) { slot_.push_back(text); } void clear() { slot_.clear(); } void addToLog(const std::string& text) { log_.push_back(text); } void clearLog() { log_.clear(); } void setEnabled(bool value) { enabled_ = value; } void toggleEnabled() { enabled_ = !enabled_; } private: // [SINGLETON] Objeto privado static Debug* debug; // Variables std::vector slot_; // Vector con los textos a escribir std::vector log_; // Vector con los textos a escribir int x_ = 0; // Posicion donde escribir el texto de debug int y_ = 0; // Posición donde escribir el texto de debug bool enabled_ = false; // Indica si esta activo el modo debug // Constructor Debug() = default; // Destructor ~Debug() = default; };