1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Preparations for merge

No longer using FuzzyEngine just to create a log-message. It's now only used when isUseFuzzy is set.
Also:
Removed < operator and instead use already existing "canAfford"-Method.
This commit is contained in:
Xilmi
2024-09-05 16:22:25 +02:00
parent b32c9615ed
commit 23cd54c998
2 changed files with 29 additions and 40 deletions

View File

@@ -189,17 +189,6 @@ public:
return this->container == rhs.container;
}
// WARNING: comparison operators are used for "can afford" relation: a <= b means that foreach i a[i] <= b[i]
// that doesn't work the other way: a > b doesn't mean that a cannot be afforded with b, it's still b can afford a
bool operator<(const ResourceSet &rhs)
{
for(int i = 0; i < size(); i++)
if (this->container.at(i) < rhs[i])
return true;
return false;
}
template <typename Handler> void serialize(Handler &h)
{
h & container;