Skip to content

Commit

Permalink
Renamed ExclusiveGroup types to not be confused with Linked Forms.
Browse files Browse the repository at this point in the history
  • Loading branch information
adya committed Mar 31, 2024
1 parent f54e8a5 commit 78f3468
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions SPID/include/ExclusiveGroups.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ namespace ExclusiveGroups
bool TryParse(const std::string& a_key, const std::string& a_value, const Path& a_path);
}

using GroupName = std::string;
using LinkedGroups = std::unordered_map<RE::TESForm*, std::unordered_set<GroupName>>;
using Groups = std::unordered_map<GroupName, std::unordered_set<RE::TESForm*>>;
using Group = std::string;
using FormGroupMap = std::unordered_map<RE::TESForm*, std::unordered_set<Group>>;
using GroupFormsMap = std::unordered_map<Group, std::unordered_set<RE::TESForm*>>;

class Manager : public ISingleton<Manager>
{
Expand Down Expand Up @@ -54,18 +54,18 @@ namespace ExclusiveGroups
/// Retrieves all exclusive groups.
/// </summary>
/// <returns>A reference to discovered exclusive groups</returns>
const Groups& GetGroups() const;
const GroupFormsMap& GetGroups() const;

private:
/// <summary>
/// A map of exclusive group names related to each form in the exclusive groups.
/// Provides a quick and easy way to get names of all groups that need to be checked.
/// </summary>
LinkedGroups linkedGroups{};
FormGroupMap linkedGroups{};

/// <summary>
/// A map of exclusive groups names and the forms that are part of each exclusive group.
/// </summary>
Groups groups{};
GroupFormsMap groups{};
};
}
4 changes: 2 additions & 2 deletions SPID/src/ExclusiveGroups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ namespace ExclusiveGroups
{
std::unordered_set<RE::TESForm*> forms{};
if (auto it = linkedGroups.find(form); it != linkedGroups.end()) {
std::ranges::for_each(it->second, [&](const GroupName& name) {
std::ranges::for_each(it->second, [&](const Group& name) {
const auto& group = groups.at(name);
forms.insert(group.begin(), group.end());
});
Expand All @@ -110,7 +110,7 @@ namespace ExclusiveGroups
return forms;
}

const Groups& ExclusiveGroups::Manager::GetGroups() const
const GroupFormsMap& ExclusiveGroups::Manager::GetGroups() const
{
return groups;
}
Expand Down

0 comments on commit 78f3468

Please sign in to comment.