refactor
This commit is contained in:
@@ -29,14 +29,14 @@ void Item::update(float delta_time) {
|
||||
}
|
||||
|
||||
// Pinta el objeto en pantalla
|
||||
void Item::render() const { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Item::render() const {
|
||||
// Calcula el índice de color basado en el tiempo acumulado
|
||||
const int INDEX = static_cast<int>(time_accumulator_ / COLOR_CHANGE_INTERVAL) % static_cast<int>(color_.size());
|
||||
sprite_->render(1, color_.at(INDEX));
|
||||
}
|
||||
|
||||
// Obtiene su ubicación
|
||||
auto Item::getPos() -> SDL_FPoint { // NOLINT(readability-convert-member-functions-to-static)
|
||||
auto Item::getPos() -> SDL_FPoint {
|
||||
const SDL_FPoint P = {.x = sprite_->getX(), .y = sprite_->getY()};
|
||||
return P;
|
||||
}
|
||||
|
||||
@@ -637,7 +637,7 @@ auto Player::skinToAnimationPath(const std::string& skin_name) -> std::string {
|
||||
// Inicialización
|
||||
// ============================================================================
|
||||
|
||||
void Player::initSprite(const std::string& animations_path) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Player::initSprite(const std::string& animations_path) {
|
||||
const auto& animation_data = Resource::Cache::get()->getAnimationData(animations_path);
|
||||
sprite_ = std::make_unique<AnimatedSprite>(animation_data);
|
||||
sprite_->setWidth(WIDTH);
|
||||
@@ -645,7 +645,7 @@ void Player::initSprite(const std::string& animations_path) { // NOLINT(readabi
|
||||
sprite_->setCurrentAnimation("walk");
|
||||
}
|
||||
|
||||
void Player::initSounds() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Player::initSounds() {
|
||||
jump_sound_ = Resource::Cache::get()->getSound(Defaults::Sound::Files::JUMP);
|
||||
land_sound_ = Resource::Cache::get()->getSound(Defaults::Sound::Files::LAND);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
Cheevos* Cheevos::cheevos = nullptr;
|
||||
|
||||
// [SINGLETON] Crearemos el objeto con esta función estática
|
||||
void Cheevos::init(const std::string& file) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Cheevos::init(const std::string& file) {
|
||||
Cheevos::cheevos = new Cheevos(file);
|
||||
}
|
||||
|
||||
@@ -43,12 +43,12 @@ Cheevos::~Cheevos() {
|
||||
}
|
||||
|
||||
// Inicializa los logros
|
||||
void Cheevos::init() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Cheevos::init() {
|
||||
cheevos_list_.clear();
|
||||
}
|
||||
|
||||
// Busca un logro por id y devuelve el indice
|
||||
auto Cheevos::find(int id) -> int { // NOLINT(readability-convert-member-functions-to-static)
|
||||
auto Cheevos::find(int id) -> int {
|
||||
for (int i = 0; i < (int)cheevos_list_.size(); ++i) {
|
||||
if (cheevos_list_[i].id == id) {
|
||||
return i;
|
||||
@@ -88,7 +88,7 @@ void Cheevos::setUnobtainable(int id) {
|
||||
}
|
||||
|
||||
// Carga el estado de los logros desde un fichero
|
||||
void Cheevos::loadFromFile() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Cheevos::loadFromFile() {
|
||||
std::ifstream file(file_, std::ios::binary);
|
||||
|
||||
// El fichero no existe
|
||||
|
||||
@@ -16,7 +16,7 @@ void EnemyManager::clear() {
|
||||
}
|
||||
|
||||
// Elimina el último enemigo de la colección
|
||||
void EnemyManager::removeLastEnemy() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void EnemyManager::removeLastEnemy() {
|
||||
if (!enemies_.empty()) {
|
||||
enemies_.pop_back();
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ void ItemManager::setPaused(bool paused) {
|
||||
}
|
||||
|
||||
// Comprueba si hay colisión con algún item
|
||||
auto ItemManager::checkCollision(SDL_FRect& rect) -> bool { // NOLINT(readability-convert-member-functions-to-static)
|
||||
auto ItemManager::checkCollision(SDL_FRect& rect) -> bool {
|
||||
for (int i = 0; i < static_cast<int>(items_.size()); ++i) {
|
||||
if (::checkCollision(rect, items_.at(i)->getCollider())) {
|
||||
// Registra el item como recogido
|
||||
|
||||
@@ -32,7 +32,7 @@ auto ItemTracker::hasBeenPicked(const std::string& name, SDL_FPoint pos) -> bool
|
||||
}
|
||||
|
||||
// Añade el objeto a la lista de objetos cogidos
|
||||
void ItemTracker::addItem(const std::string& name, SDL_FPoint pos) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void ItemTracker::addItem(const std::string& name, SDL_FPoint pos) {
|
||||
// Comprueba si el objeto no ha sido recogido con anterioridad
|
||||
if (!hasBeenPicked(name, pos)) {
|
||||
// Primero busca si ya hay una entrada con ese nombre
|
||||
@@ -47,7 +47,7 @@ void ItemTracker::addItem(const std::string& name, SDL_FPoint pos) { // NOLINT(
|
||||
}
|
||||
|
||||
// Busca una entrada en la lista por nombre
|
||||
auto ItemTracker::findByName(const std::string& name) -> int { // NOLINT(readability-convert-member-functions-to-static)
|
||||
auto ItemTracker::findByName(const std::string& name) -> int {
|
||||
int i = 0;
|
||||
|
||||
for (const auto& item : items_) {
|
||||
@@ -61,7 +61,7 @@ auto ItemTracker::findByName(const std::string& name) -> int { // NOLINT(readab
|
||||
}
|
||||
|
||||
// Busca una entrada en la lista por posición
|
||||
auto ItemTracker::findByPos(int index, SDL_FPoint pos) -> int { // NOLINT(readability-convert-member-functions-to-static)
|
||||
auto ItemTracker::findByPos(int index, SDL_FPoint pos) -> int {
|
||||
int i = 0;
|
||||
|
||||
for (const auto& item : items_[index].pos) {
|
||||
|
||||
@@ -278,7 +278,7 @@ void Room::updateSolidActorBorders(const SolidActorManager::AdjacentActors& adja
|
||||
}
|
||||
|
||||
// Devuelve la cadena del fichero de la habitación contigua segun el borde
|
||||
auto Room::getRoom(Border border) -> std::string { // NOLINT(readability-convert-member-functions-to-static)
|
||||
auto Room::getRoom(Border border) -> std::string {
|
||||
switch (border) {
|
||||
case Border::TOP:
|
||||
return upper_room_;
|
||||
@@ -310,6 +310,6 @@ void Room::tryUnlockDoors(const SDL_FRect& player_rect) {
|
||||
}
|
||||
|
||||
// Carga una habitación desde un archivo YAML (delegado a RoomFormat)
|
||||
auto Room::loadYAML(const std::string& file_path, bool verbose) -> Data { // NOLINT(readability-convert-member-functions-to-static)
|
||||
auto Room::loadYAML(const std::string& file_path, bool verbose) -> Data {
|
||||
return RoomFormat::loadYAML(file_path, verbose);
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#include <algorithm> // Para std::ranges::any_of
|
||||
|
||||
// Comprueba si la habitación ya ha sido visitada
|
||||
auto RoomTracker::hasBeenVisited(const std::string& name) -> bool { // NOLINT(readability-convert-member-functions-to-static)
|
||||
auto RoomTracker::hasBeenVisited(const std::string& name) -> bool {
|
||||
return std::ranges::any_of(rooms_, [&name](const auto& l) -> bool { return l == name; });
|
||||
}
|
||||
|
||||
// Añade la habitación a la lista
|
||||
auto RoomTracker::addRoom(const std::string& name) -> bool { // NOLINT(readability-convert-member-functions-to-static)
|
||||
auto RoomTracker::addRoom(const std::string& name) -> bool {
|
||||
// Comprueba si la habitación ya ha sido visitada
|
||||
if (!hasBeenVisited(name)) {
|
||||
// En caso contrario añádela a la lista
|
||||
|
||||
@@ -210,10 +210,10 @@ void Game::handleEvents() {
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_9 && static_cast<int>(event.key.repeat) == 0) {
|
||||
if (MapEditor::get()->isActive()) {
|
||||
GameControl::exit_editor();
|
||||
Notifier::get()->show({Locale::get()->get("game.editor_disabled")}); // NOLINT(readability-static-accessed-through-instance)
|
||||
Notifier::get()->show({Locale::get()->get("game.editor_disabled")});
|
||||
} else {
|
||||
GameControl::enter_editor();
|
||||
Notifier::get()->show({Locale::get()->get("game.editor_enabled")}); // NOLINT(readability-static-accessed-through-instance)
|
||||
Notifier::get()->show({Locale::get()->get("game.editor_enabled")});
|
||||
}
|
||||
} else if (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_G && static_cast<int>(event.key.repeat) == 0 && MapEditor::get()->isActive()) {
|
||||
MapEditor::get()->showGrid(!MapEditor::get()->isGridEnabled());
|
||||
@@ -259,9 +259,9 @@ void Game::handleInput() {
|
||||
}
|
||||
|
||||
// Input de pausa solo en estado PLAYING
|
||||
if (Input::get()->checkAction(InputAction::PAUSE, Input::DO_NOT_ALLOW_REPEAT)) { // NOLINT(readability-static-accessed-through-instance)
|
||||
if (Input::get()->checkAction(InputAction::PAUSE, Input::DO_NOT_ALLOW_REPEAT)) {
|
||||
togglePause();
|
||||
Notifier::get()->show({paused_ ? Locale::get()->get("game.paused") : Locale::get()->get("game.running")}); // NOLINT(readability-static-accessed-through-instance)
|
||||
Notifier::get()->show({paused_ ? Locale::get()->get("game.paused") : Locale::get()->get("game.running")});
|
||||
}
|
||||
|
||||
GlobalInputs::handle();
|
||||
@@ -611,7 +611,7 @@ void Game::renderPostFadeEnding() {
|
||||
static void toggleCheat(Options::Cheat::State& cheat, const std::string& label) {
|
||||
cheat = (cheat == Options::Cheat::State::ENABLED) ? Options::Cheat::State::DISABLED : Options::Cheat::State::ENABLED;
|
||||
const bool ENABLED = (cheat == Options::Cheat::State::ENABLED);
|
||||
Notifier::get()->show({label + (ENABLED ? Locale::get()->get("game.enabled") : Locale::get()->get("game.disabled"))}, Notifier::Style::DEFAULT, -1, true); // NOLINT(readability-static-accessed-through-instance)
|
||||
Notifier::get()->show({label + (ENABLED ? Locale::get()->get("game.enabled") : Locale::get()->get("game.disabled"))}, Notifier::Style::DEFAULT, -1, true);
|
||||
}
|
||||
|
||||
// Pone la información de debug en pantalla
|
||||
@@ -638,7 +638,7 @@ void Game::renderDebugInfo() {
|
||||
}
|
||||
|
||||
// Comprueba los eventos
|
||||
void Game::handleDebugEvents(const SDL_Event& event) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Game::handleDebugEvents(const SDL_Event& event) {
|
||||
if (event.type == SDL_EVENT_KEY_DOWN && static_cast<int>(event.key.repeat) == 0) {
|
||||
switch (event.key.key) {
|
||||
case SDLK_R:
|
||||
@@ -662,15 +662,15 @@ void Game::handleDebugEvents(const SDL_Event& event) { // NOLINT(readability-co
|
||||
break;
|
||||
|
||||
case SDLK_1:
|
||||
toggleCheat(Options::cheats.infinite_lives, Locale::get()->get("game.cheat_infinite_lives")); // NOLINT(readability-static-accessed-through-instance)
|
||||
toggleCheat(Options::cheats.infinite_lives, Locale::get()->get("game.cheat_infinite_lives"));
|
||||
break;
|
||||
|
||||
case SDLK_2:
|
||||
toggleCheat(Options::cheats.invincible, Locale::get()->get("game.cheat_invincible")); // NOLINT(readability-static-accessed-through-instance)
|
||||
toggleCheat(Options::cheats.invincible, Locale::get()->get("game.cheat_invincible"));
|
||||
break;
|
||||
|
||||
case SDLK_7:
|
||||
Notifier::get()->show({Locale::get()->get("achievements.header"), Locale::get()->get("achievements.c11")}, Notifier::Style::CHEEVO, -1, false, "F7"); // NOLINT(readability-static-accessed-through-instance)
|
||||
Notifier::get()->show({Locale::get()->get("achievements.header"), Locale::get()->get("achievements.c11")}, Notifier::Style::CHEEVO, -1, false, "F7");
|
||||
break;
|
||||
|
||||
case SDLK_0: {
|
||||
@@ -679,7 +679,7 @@ void Game::handleDebugEvents(const SDL_Event& event) { // NOLINT(readability-co
|
||||
invincible_before_debug_ = (Options::cheats.invincible == Options::Cheat::State::ENABLED);
|
||||
}
|
||||
Debug::get()->toggleEnabled();
|
||||
Notifier::get()->show({Debug::get()->isEnabled() ? Locale::get()->get("game.debug_enabled") : Locale::get()->get("game.debug_disabled")}); // NOLINT(readability-static-accessed-through-instance)
|
||||
Notifier::get()->show({Debug::get()->isEnabled() ? Locale::get()->get("game.debug_enabled") : Locale::get()->get("game.debug_disabled")});
|
||||
room_->redrawMap();
|
||||
if (Debug::get()->isEnabled()) {
|
||||
Options::cheats.invincible = Options::Cheat::State::ENABLED;
|
||||
@@ -779,7 +779,7 @@ auto Game::changeRoom(const std::string& room_path) -> bool {
|
||||
}
|
||||
|
||||
// Verifica que exista el fichero que se va a cargar
|
||||
if (!Resource::List::get()->get(room_path).empty()) { // NOLINT(readability-static-accessed-through-instance)
|
||||
if (!Resource::List::get()->get(room_path).empty()) {
|
||||
// Obtiene la habitación del caché o la crea
|
||||
room_ = getOrCreateRoom(room_path);
|
||||
|
||||
@@ -1013,7 +1013,7 @@ void Game::togglePause() {
|
||||
}
|
||||
|
||||
// Inicializa al jugador
|
||||
void Game::initPlayer(const Player::SpawnData& spawn_point, std::shared_ptr<Room> room) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Game::initPlayer(const Player::SpawnData& spawn_point, std::shared_ptr<Room> room) {
|
||||
const bool IGNORE_INPUT = player_ != nullptr && player_->getIgnoreInput();
|
||||
std::string player_animations = Player::skinToAnimationPath(Defaults::Game::Player::SKIN);
|
||||
const Player::Data PLAYER{.spawn_data = spawn_point, .animations_path = player_animations, .room = std::move(room)};
|
||||
|
||||
@@ -94,7 +94,7 @@ void Logo::updateJAILGAMES(float delta_time) {
|
||||
}
|
||||
|
||||
// Calcula el índice de color según el progreso (0.0-1.0)
|
||||
auto Logo::getColorIndex(float progress) const -> int { // NOLINT(readability-convert-member-functions-to-static)
|
||||
auto Logo::getColorIndex(float progress) const -> int {
|
||||
// Asegurar que progress esté en el rango [0.0, 1.0]
|
||||
progress = std::clamp(progress, 0.0F, 1.0F);
|
||||
|
||||
@@ -213,7 +213,7 @@ void Logo::update() {
|
||||
}
|
||||
|
||||
// Dibuja en pantalla
|
||||
void Logo::render() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Logo::render() {
|
||||
// Prepara para empezar a dibujar en la textura de juego
|
||||
Screen::get()->start();
|
||||
Screen::get()->clearSurface(0);
|
||||
@@ -234,7 +234,7 @@ void Logo::endSection() {
|
||||
}
|
||||
|
||||
// Inicializa el vector de colores
|
||||
void Logo::initColors() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Logo::initColors() {
|
||||
// Inicializa el vector de colores
|
||||
const std::vector<Uint8> COLORS = {
|
||||
0,
|
||||
@@ -251,7 +251,7 @@ void Logo::initColors() { // NOLINT(readability-convert-member-functions-to-sta
|
||||
}
|
||||
|
||||
// Crea los sprites de cada linea
|
||||
void Logo::initSprites() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Logo::initSprites() {
|
||||
const float WIDTH = jailgames_surface_->getWidth();
|
||||
jailgames_initial_x_.reserve(jailgames_surface_->getHeight());
|
||||
|
||||
|
||||
@@ -351,7 +351,7 @@ auto Title::isKeyValid(SDL_Scancode scancode) -> bool {
|
||||
}
|
||||
|
||||
// Verifica si una tecla ya fue usada en pasos anteriores
|
||||
auto Title::isKeyDuplicate(SDL_Scancode scancode, int current_step) -> bool { // NOLINT(readability-convert-member-functions-to-static)
|
||||
auto Title::isKeyDuplicate(SDL_Scancode scancode, int current_step) -> bool {
|
||||
for (int i = 0; i < current_step; i++) {
|
||||
if (temp_keys_[i] == scancode) {
|
||||
return true;
|
||||
@@ -361,7 +361,7 @@ auto Title::isKeyDuplicate(SDL_Scancode scancode, int current_step) -> bool { /
|
||||
}
|
||||
|
||||
// Aplica y guarda las teclas redefinidas
|
||||
void Title::applyKeyboardRemap() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Title::applyKeyboardRemap() {
|
||||
// Guardar las nuevas teclas en Options::controls
|
||||
Options::keyboard_controls.key_left = temp_keys_[0];
|
||||
Options::keyboard_controls.key_right = temp_keys_[1];
|
||||
@@ -399,17 +399,17 @@ void Title::renderKeyboardRemap() const {
|
||||
const int KEYS_START_Y = START_Y + (2 * LINE_SPACING);
|
||||
if (remap_step_ > 0) {
|
||||
const std::string LEFT_KEY = SDL_GetScancodeName(temp_keys_[0]);
|
||||
const std::string LEFT_MSG = loc->get("title.keys.label0") + LEFT_KEY; // NOLINT(readability-static-accessed-through-instance)
|
||||
const std::string LEFT_MSG = loc->get("title.keys.label0") + LEFT_KEY;
|
||||
menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, KEYS_START_Y, LEFT_MSG, 1, COLOR);
|
||||
}
|
||||
if (remap_step_ > 1) {
|
||||
const std::string RIGHT_KEY = SDL_GetScancodeName(temp_keys_[1]);
|
||||
const std::string RIGHT_MSG = loc->get("title.keys.label1") + RIGHT_KEY; // NOLINT(readability-static-accessed-through-instance)
|
||||
const std::string RIGHT_MSG = loc->get("title.keys.label1") + RIGHT_KEY;
|
||||
menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, KEYS_START_Y + LINE_SPACING, RIGHT_MSG, 1, COLOR);
|
||||
}
|
||||
if (remap_step_ >= 3) {
|
||||
const std::string JUMP_KEY = SDL_GetScancodeName(temp_keys_[2]);
|
||||
const std::string JUMP_MSG = loc->get("title.keys.label2") + JUMP_KEY; // NOLINT(readability-static-accessed-through-instance)
|
||||
const std::string JUMP_MSG = loc->get("title.keys.label2") + JUMP_KEY;
|
||||
menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, KEYS_START_Y + (2 * LINE_SPACING), JUMP_MSG, 1, COLOR);
|
||||
}
|
||||
|
||||
@@ -443,17 +443,17 @@ void Title::renderJoystickRemap() const {
|
||||
const int BUTTONS_START_Y = START_Y + (2 * LINE_SPACING);
|
||||
if (remap_step_ > 0) {
|
||||
const std::string LEFT_BTN = getButtonName(temp_buttons_[0]);
|
||||
const std::string LEFT_MSG = loc->get("title.keys.label0") + LEFT_BTN; // NOLINT(readability-static-accessed-through-instance)
|
||||
const std::string LEFT_MSG = loc->get("title.keys.label0") + LEFT_BTN;
|
||||
menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, BUTTONS_START_Y, LEFT_MSG, 1, COLOR);
|
||||
}
|
||||
if (remap_step_ > 1) {
|
||||
const std::string RIGHT_BTN = getButtonName(temp_buttons_[1]);
|
||||
const std::string RIGHT_MSG = loc->get("title.keys.label1") + RIGHT_BTN; // NOLINT(readability-static-accessed-through-instance)
|
||||
const std::string RIGHT_MSG = loc->get("title.keys.label1") + RIGHT_BTN;
|
||||
menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, BUTTONS_START_Y + LINE_SPACING, RIGHT_MSG, 1, COLOR);
|
||||
}
|
||||
if (remap_step_ >= 3) {
|
||||
const std::string JUMP_BTN = getButtonName(temp_buttons_[2]);
|
||||
const std::string JUMP_MSG = loc->get("title.keys.label2") + JUMP_BTN; // NOLINT(readability-static-accessed-through-instance)
|
||||
const std::string JUMP_MSG = loc->get("title.keys.label2") + JUMP_BTN;
|
||||
menu_text_->writeDX(Text::CENTER_FLAG | Text::COLOR_FLAG, PlayArea::CENTER_X, BUTTONS_START_Y + (2 * LINE_SPACING), JUMP_MSG, 1, COLOR);
|
||||
}
|
||||
|
||||
@@ -522,7 +522,7 @@ void Title::handleJoystickRemap(const SDL_Event& event) {
|
||||
}
|
||||
|
||||
// Valida si un botón está duplicado
|
||||
auto Title::isButtonDuplicate(int button, int current_step) -> bool { // NOLINT(readability-convert-member-functions-to-static)
|
||||
auto Title::isButtonDuplicate(int button, int current_step) -> bool {
|
||||
for (int i = 0; i < current_step; ++i) {
|
||||
if (temp_buttons_[i] == button) {
|
||||
return true;
|
||||
@@ -532,7 +532,7 @@ auto Title::isButtonDuplicate(int button, int current_step) -> bool { // NOLINT
|
||||
}
|
||||
|
||||
// Aplica y guarda los botones del gamepad redefinidos
|
||||
void Title::applyJoystickRemap() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Title::applyJoystickRemap() {
|
||||
// Guardar los nuevos botones en Options::gamepad_controls
|
||||
Options::gamepad_controls.button_left = temp_buttons_[0];
|
||||
Options::gamepad_controls.button_right = temp_buttons_[1];
|
||||
@@ -546,7 +546,7 @@ void Title::applyJoystickRemap() { // NOLINT(readability-convert-member-functio
|
||||
}
|
||||
|
||||
// Retorna el nombre amigable del botón del gamepad
|
||||
auto Title::getButtonName(int button) -> std::string { // NOLINT(readability-convert-member-functions-to-static)
|
||||
auto Title::getButtonName(int button) -> std::string {
|
||||
// Triggers especiales
|
||||
if (button == Input::TRIGGER_L2_AS_BUTTON) {
|
||||
return "L2";
|
||||
|
||||
@@ -44,7 +44,7 @@ const Notifier::Style Notifier::Style::CHEEVO = {
|
||||
.play_sound = true};
|
||||
|
||||
// [SINGLETON] Crearemos el objeto con esta función estática
|
||||
void Notifier::init(const std::string& icon_file, const std::string& text) { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Notifier::init(const std::string& icon_file, const std::string& text) {
|
||||
Notifier::notifier = new Notifier(icon_file, text);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ void Notifier::update(float delta_time) {
|
||||
}
|
||||
|
||||
// Elimina las notificaciones finalizadas
|
||||
void Notifier::clearFinishedNotifications() { // NOLINT(readability-convert-member-functions-to-static)
|
||||
void Notifier::clearFinishedNotifications() {
|
||||
auto result = std::ranges::remove_if(notifications_, [](const Notification& notification) -> bool {
|
||||
return notification.state == Status::FINISHED;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user