Skip to content

Commit

Permalink
Rename getTags to allTags for API consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Madour committed Jun 15, 2024
1 parent 1bbd931 commit b6dd95c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/LDtkLoader/Entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace ldtk {
auto getNineSliceBorders() const -> const NineSliceBorders&;

auto hasTag(const std::string& tag) const -> bool;
auto getTags() const -> const std::vector<std::string>&;
auto allTags() const -> const std::vector<std::string>&;

auto allFields() const -> const std::vector<FieldDef>&;

Expand Down
2 changes: 1 addition & 1 deletion include/LDtkLoader/containers/TagsContainer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ldtk {
{
public:
auto hasTag(const std::string& tag) const -> bool;
auto getTags() const -> const std::vector<std::string>&;
auto allTags() const -> const std::vector<std::string>&;

protected:
explicit TagsContainer(const nlohmann::json& j);
Expand Down
4 changes: 2 additions & 2 deletions src/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ auto Entity::hasTag(const std::string& tag) const -> bool
return m_definition->hasTag(tag);
}

auto Entity::getTags() const -> const std::vector<std::string>&
auto Entity::allTags() const -> const std::vector<std::string>&
{
return m_definition->getTags();
return m_definition->allTags();
}

auto Entity::allFields() const -> const std::vector<FieldDef>&
Expand Down
2 changes: 1 addition & 1 deletion src/Layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Layer::Layer(const nlohmann::json& j, const World* w, const Level* l)
m_entities.emplace_back(ent, w, this);
auto& new_ent = m_entities.back();
m_entities_by_name[new_ent.getName()].emplace_back(new_ent);
for (const auto& tag : new_ent.getTags()) {
for (const auto& tag : new_ent.allTags()) {
m_entities_by_tag[tag].emplace_back(new_ent);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/TagsContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ auto TagsContainer::hasTag(const std::string& tag) const -> bool
return pos != m_tags.end();
}

auto TagsContainer::getTags() const -> const std::vector<std::string>&
auto TagsContainer::allTags() const -> const std::vector<std::string>&
{
return m_tags;
}

0 comments on commit b6dd95c

Please sign in to comment.