فهرست منبع

HeroBonus: removed unused functions

Konstantin 2 سال پیش
والد
کامیت
0e69aac96f
2فایلهای تغییر یافته به همراه2 افزوده شده و 23 حذف شده
  1. 0 14
      lib/HeroBonus.cpp
  2. 2 9
      lib/HeroBonus.h

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

+ 2 - 9
lib/HeroBonus.h

@@ -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
 {