diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-25 22:47:37 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-25 22:47:37 +0100 |
commit | e8ac228ea8ea6f760d2af63a3dc006eca81b8703 (patch) | |
tree | d9d7220b7cb00128fb04eab52da839ff01e263cc | |
parent | a65ff5d518b4ec8c28d99ce7bbe79c988529690a (diff) |
a
-rw-r--r-- | serialize/wall-atlas.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/serialize/wall-atlas.cpp b/serialize/wall-atlas.cpp index 0a288b1f..4e8a2b28 100644 --- a/serialize/wall-atlas.cpp +++ b/serialize/wall-atlas.cpp @@ -25,20 +25,21 @@ namespace { struct direction_triple { - std::vector<Direction> dirs; + std::vector<Direction> array; std::array<DirArrayIndex, Direction_COUNT> map; std::bitset<Direction_COUNT> mask; }; direction_triple read_all_directions(const json& jroot) { - std::bitset<Direction_COUNT> mask{0}; size_t count = 0; for (auto [str, _] : wall_atlas::directions) if (jroot.contains(str)) count++; - std::vector<Direction> array{count}; - std::array<DirArrayIndex, Direction_COUNT> map = {}; + direction_triple ret = { std::vector<Direction>{count}, + std::array<DirArrayIndex, Direction_COUNT>{}, + std::bitset<Direction_COUNT>{0}, }; + auto& [array, map, mask] = ret; for (uint8_t i = 0, pos = 0; i < std::size(wall_atlas::directions); i++) { auto [str, dir] = wall_atlas::directions[i]; @@ -49,7 +50,7 @@ direction_triple read_all_directions(const json& jroot) array[pos++] = read_direction_metadata(jroot, dir); } } - return { std::move(array), std::move(map), mask }; + return ret; } } // namespace |