diff --git a/lib/HeroBonus.cpp b/lib/HeroBonus.cpp index 109b74e50..3830f3298 100644 --- a/lib/HeroBonus.cpp +++ b/lib/HeroBonus.cpp @@ -1538,20 +1538,6 @@ int64_t CBonusSystemNode::getTreeVersion() const return ret << 32; } -int NBonus::valOf(const CBonusSystemNode *obj, Bonus::BonusType type, int subtype) -{ - if(obj) - return obj->valOfBonuses(type, subtype); - return 0; -} - -bool NBonus::hasOfType(const CBonusSystemNode *obj, Bonus::BonusType type, int subtype) -{ - if(obj) - return obj->hasBonusOfType(type, subtype); - return false; -} - std::string Bonus::Description(boost::optional customValue) const { std::ostringstream str; diff --git a/lib/HeroBonus.h b/lib/HeroBonus.h index 195d4bc93..ea3b93801 100644 --- a/lib/HeroBonus.h +++ b/lib/HeroBonus.h @@ -34,9 +34,9 @@ typedef std::vector TNodesVector; class CSelector : std::function { - typedef std::function TBase; + using TBase = std::function; public: - CSelector() {} + CSelector() = default; template CSelector(const T &t, //SFINAE trick -> include this c-tor in overload resolution only if parameter is class //(includes functors, lambdas) or function. Without that VC is going mad about ambiguities. @@ -905,13 +905,6 @@ public: } }; -namespace NBonus -{ - //set of methods that may be safely called with nullptr objs - DLL_LINKAGE int valOf(const CBonusSystemNode *obj, Bonus::BonusType type, int subtype = -1); //subtype -> subtype of bonus, if -1 then any - DLL_LINKAGE bool hasOfType(const CBonusSystemNode *obj, Bonus::BonusType type, int subtype = -1);//determines if hero has a bonus of given type (and optionally subtype) -} - template class CSelectFieldEqual {