forked from jaildesigner-jailgames/jaildoctors_dilemma
linter
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <algorithm> // Para remove_if
|
||||
#include <iterator> // Para prev
|
||||
#include <ranges> // Para reverse_view
|
||||
#include <string> // Para string, basic_string
|
||||
#include <vector> // Para vector
|
||||
|
||||
@@ -44,8 +45,8 @@ Notifier::Notifier(const std::string& icon_file, const std::string& text)
|
||||
|
||||
// Dibuja las notificaciones por pantalla
|
||||
void Notifier::render() {
|
||||
for (auto it = notifications_.rbegin(); it != notifications_.rend(); ++it) {
|
||||
it->sprite->render();
|
||||
for (auto& notification : std::ranges::reverse_view(notifications_)) {
|
||||
notification.sprite->render();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,11 +105,10 @@ void Notifier::update() {
|
||||
|
||||
// Elimina las notificaciones finalizadas
|
||||
void Notifier::clearFinishedNotifications() {
|
||||
notifications_.erase(
|
||||
std::remove_if(notifications_.begin(), notifications_.end(), [](const Notification& notification) {
|
||||
return notification.state == Status::FINISHED;
|
||||
}),
|
||||
notifications_.end());
|
||||
auto result = std::ranges::remove_if(notifications_, [](const Notification& notification) {
|
||||
return notification.state == Status::FINISHED;
|
||||
});
|
||||
notifications_.erase(result.begin(), result.end());
|
||||
}
|
||||
|
||||
void Notifier::show(std::vector<std::string> texts, NotificationText text_is, Uint32 display_duration, int icon, bool can_be_removed, const std::string& code) {
|
||||
@@ -123,8 +123,8 @@ void Notifier::show(std::vector<std::string> texts, NotificationText text_is, Ui
|
||||
}
|
||||
|
||||
// Elimina las cadenas vacías
|
||||
texts.erase(std::remove_if(texts.begin(), texts.end(), [](const std::string& s) { return s.empty(); }),
|
||||
texts.end());
|
||||
auto result = std::ranges::remove_if(texts, [](const std::string& s) { return s.empty(); });
|
||||
texts.erase(result.begin(), result.end());
|
||||
|
||||
// Encuentra la cadena más larga
|
||||
std::string longest;
|
||||
|
||||
Reference in New Issue
Block a user