浏览代码

miniscule bonus system cleanup

update comments, remove one never used method, make another method private
K 1 年之前
父节点
当前提交
bda1adbdfd
共有 3 个文件被更改,包括 2 次插入12 次删除
  1. 0 7
      lib/bonuses/CBonusSystemNode.cpp
  2. 1 2
      lib/bonuses/CBonusSystemNode.h
  3. 1 3
      lib/bonuses/IBonusBearer.h

+ 0 - 7
lib/bonuses/CBonusSystemNode.cpp

@@ -625,13 +625,6 @@ void CBonusSystemNode::limitBonuses(const BonusList &allBonuses, BonusList &out)
 	}
 }
 
-TBonusListPtr CBonusSystemNode::limitBonuses(const BonusList &allBonuses) const
-{
-	auto ret = std::make_shared<BonusList>();
-	limitBonuses(allBonuses, *ret);
-	return ret;
-}
-
 void CBonusSystemNode::treeHasChanged()
 {
 	treeChanged++;

+ 1 - 2
lib/bonuses/CBonusSystemNode.h

@@ -55,6 +55,7 @@ private:
 	void getAllBonusesRec(BonusList &out, const CSelector & selector) const;
 	TConstBonusListPtr getAllBonusesWithoutCaching(const CSelector &selector, const CSelector &limit) const;
 	std::shared_ptr<Bonus> getUpdatedBonus(const std::shared_ptr<Bonus> & b, const TUpdaterPtr & updater) const;
+	void limitBonuses(const BonusList &allBonuses, BonusList &out) const; //out will bo populed with bonuses that are not limited here
 
 	void getRedParents(TCNodes &out) const;  //retrieves list of red parent nodes (nodes bonuses propagate from)
 	void getRedAncestors(TCNodes &out) const;
@@ -84,8 +85,6 @@ public:
 	explicit CBonusSystemNode(ENodeTypes NodeType);
 	virtual ~CBonusSystemNode();
 
-	void limitBonuses(const BonusList &allBonuses, BonusList &out) const; //out will bo populed with bonuses that are not limited here
-	TBonusListPtr limitBonuses(const BonusList &allBonuses) const; //same as above, returns out by val for convenience
 	TConstBonusListPtr getAllBonuses(const CSelector &selector, const CSelector &limit, const std::string &cachingStr = "") const override;
 	void getParents(TCNodes &out) const;  //retrieves list of parent nodes (nodes to inherit bonuses from),
 

+ 1 - 3
lib/bonuses/IBonusBearer.h

@@ -17,9 +17,7 @@ class DLL_LINKAGE IBonusBearer
 {
 public:
 	//new bonusing node interface
-	// * selector is predicate that tests if HeroBonus matches our criteria
-	// * root is node on which call was made (nullptr will be replaced with this)
-	//interface
+	// * selector is predicate that tests if Bonus matches our criteria
 	IBonusBearer() = default;
 	virtual ~IBonusBearer() = default;
 	virtual TConstBonusListPtr getAllBonuses(const CSelector &selector, const CSelector &limit, const std::string &cachingStr = "") const = 0;