From bb17be56d2cd22949bf485c518d543a7e79a6b7d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Mon, 24 Oct 2022 14:04:51 +0200 Subject: a --- editor/editor.cpp | 10 +++++----- editor/editor.hpp | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'editor') diff --git a/editor/editor.cpp b/editor/editor.cpp index b353aa4d..bea41116 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -15,7 +15,7 @@ namespace floormat { static const std::filesystem::path image_path{IMAGE_PATH, std::filesystem::path::generic_format}; -tile_editor::tile_editor(editor_mode mode, Containers::StringView name) : _name{ name}, _mode{ mode} +tile_editor::tile_editor(editor_mode mode, StringView name) : _name{ name}, _mode{ mode} { load_atlases(); } @@ -25,7 +25,7 @@ void tile_editor::load_atlases() using atlas_array = std::vector>; for (auto& atlas : json_helper::from_json(image_path/(_name + ".json"))) { - Containers::StringView name = atlas->name(); + StringView name = atlas->name(); if (auto x = name.findLast('.'); x) name = name.prefix(x.data()); auto& [_, vec] = _permutation; @@ -34,11 +34,11 @@ void tile_editor::load_atlases() } } -std::shared_ptr tile_editor::maybe_atlas(Containers::StringView str) +std::shared_ptr tile_editor::maybe_atlas(StringView str) { auto it = std::find_if(_atlases.begin(), _atlases.end(), [&](const auto& tuple) -> bool { const auto& [x, _] = tuple; - return Containers::StringView{x} == str; + return StringView{x} == str; }); if (it == _atlases.end()) return nullptr; @@ -46,7 +46,7 @@ std::shared_ptr tile_editor::maybe_atlas(Containers::StringView str) return it->second; } -std::shared_ptr tile_editor::atlas(Containers::StringView str) +std::shared_ptr tile_editor::atlas(StringView str) { if (auto ptr = maybe_atlas(str); ptr) return ptr; diff --git a/editor/editor.hpp b/editor/editor.hpp index d952b9ba..e7f81305 100644 --- a/editor/editor.hpp +++ b/editor/editor.hpp @@ -22,14 +22,14 @@ struct world; struct tile_editor final { - tile_editor(editor_mode mode, Containers::StringView name); - std::shared_ptr maybe_atlas(Containers::StringView str); - std::shared_ptr atlas(Containers::StringView str); + tile_editor(editor_mode mode, StringView name); + std::shared_ptr maybe_atlas(StringView str); + std::shared_ptr atlas(StringView str); auto cbegin() const { return _atlases.cbegin(); } auto cend() const { return _atlases.cend(); } auto begin() const { return _atlases.cbegin(); } auto end() const { return _atlases.cend(); } - Containers::StringView name() const { return _name; } + StringView name() const { return _name; } editor_mode mode() const { return _mode; } void clear_selection(); -- cgit v1.2.3