1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

vcmi: add a Not bonus selector.

It will allow us to form complex selector logics with full boolean
operator.
This commit is contained in:
Konstantin
2023-03-04 01:23:15 +03:00
parent b59ee5fecc
commit ee90400d66

View File

@@ -59,6 +59,12 @@ public:
return [thisCopy, rhs](const Bonus *b) mutable { return thisCopy(b) || rhs(b); };
}
CSelector Not() const
{
auto thisCopy = *this;
return [thisCopy](const Bonus *b) mutable { return !thisCopy(b); };
}
bool operator()(const Bonus *b) const
{
return TBase::operator()(b);