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

HeroBonus: removed unused functions

This commit is contained in:
Konstantin
2023-03-29 15:23:23 +03:00
parent 89fd742c1a
commit 0e69aac96f
2 changed files with 2 additions and 23 deletions

View File

@@ -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<si32> customValue) const
{
std::ostringstream str;

View File

@@ -34,9 +34,9 @@ typedef std::vector<CBonusSystemNode *> TNodesVector;
class CSelector : std::function<bool(const Bonus*)>
{
typedef std::function<bool(const Bonus*)> TBase;
using TBase = std::function<bool(const Bonus*)>;
public:
CSelector() {}
CSelector() = default;
template<typename T>
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<typename T>
class CSelectFieldEqual
{