Skip to content

Commit

Permalink
Implemented missing empty() for Linked Distribution.
Browse files Browse the repository at this point in the history
  • Loading branch information
adya committed Apr 9, 2024
1 parent bceefa0 commit 9e9ca9e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
7 changes: 7 additions & 0 deletions SPID/include/LinkedDistribution.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ namespace LinkedDistribution
type(type)
{}

bool IsEmpty(DistributionType type) const {
if (const auto it = forms.find(type); it != forms.end()) {
return it->second.empty();
}
return true;
}

RECORD::TYPE GetType() const { return type; }
const FormsMap& GetForms() const { return forms; }

Expand Down
2 changes: 1 addition & 1 deletion SPID/src/DistributeManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ namespace Distribute
{
using namespace Forms;

logger::info("{:*^50}", "RESULTS");
logger::info("{:*^50}", "MAIN MENU DISTRIBUTION");

ForEachDistributable([&]<typename Form>(Distributables<Form>& a_distributable) {
if (a_distributable && a_distributable.GetType() != RECORD::kDeathItem) {
Expand Down
12 changes: 11 additions & 1 deletion SPID/src/LinkedDistribution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,17 @@ namespace LinkedDistribution

bool Manager::IsEmpty(DistributionType type) const
{
return false;
return spells.IsEmpty(type) &&
perks.IsEmpty(type) &&
items.IsEmpty(type) &&
shouts.IsEmpty(type) &&
levSpells.IsEmpty(type) &&
packages.IsEmpty(type) &&
outfits.IsEmpty(type) &&
keywords.IsEmpty(type) &&
factions.IsEmpty(type) &&
sleepOutfits.IsEmpty(type) &&
skins.IsEmpty(type);
}
#pragma endregion
}

0 comments on commit 9e9ca9e

Please sign in to comment.