neteja cppcheck (44 → 0) i aïllar impls de tercers
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
#include "game/gameplay/room_format.hpp"
|
||||
|
||||
#include <algorithm> // Para std::ranges::copy, transform
|
||||
#include <exception> // Para exception
|
||||
#include <iostream> // Para cout, cerr
|
||||
#include <iterator> // Para std::back_inserter
|
||||
|
||||
#include "core/resources/resource_helper.hpp" // Para Resource::Helper
|
||||
#include "external/fkyaml_node.hpp" // Para fkyaml::node
|
||||
@@ -38,9 +40,7 @@ namespace {
|
||||
std::vector<int> row;
|
||||
row.reserve(Map::WIDTH);
|
||||
|
||||
for (const auto& tile_node : row_node) {
|
||||
row.push_back(tile_node.get_value<int>());
|
||||
}
|
||||
std::ranges::transform(row_node, std::back_inserter(row), [](const auto& tile_node) { return tile_node.template get_value<int>(); });
|
||||
|
||||
tilemap_2d.push_back(row);
|
||||
}
|
||||
@@ -81,9 +81,7 @@ auto RoomFormat::flattenTilemap(const std::vector<std::vector<int>>& tilemap_2d)
|
||||
tilemap_flat.reserve(static_cast<size_t>(Map::WIDTH) * static_cast<size_t>(Map::HEIGHT));
|
||||
|
||||
for (const auto& row : tilemap_2d) {
|
||||
for (int tile : row) {
|
||||
tilemap_flat.push_back(tile);
|
||||
}
|
||||
std::ranges::copy(row, std::back_inserter(tilemap_flat));
|
||||
}
|
||||
|
||||
return tilemap_flat;
|
||||
|
||||
Reference in New Issue
Block a user