mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
CBonusSystemNode: make some properties private
This commit is contained in:
@ -218,11 +218,6 @@ std::shared_ptr<Bonus> CBonusSystemNode::getUpdatedBonus(const std::shared_ptr<B
|
|||||||
return updater->createUpdatedBonus(b, * this);
|
return updater->createUpdatedBonus(b, * this);
|
||||||
}
|
}
|
||||||
|
|
||||||
CBonusSystemNode::CBonusSystemNode()
|
|
||||||
:CBonusSystemNode(false)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
CBonusSystemNode::CBonusSystemNode(bool isHypotetic):
|
CBonusSystemNode::CBonusSystemNode(bool isHypotetic):
|
||||||
bonuses(true),
|
bonuses(true),
|
||||||
exportedBonuses(true),
|
exportedBonuses(true),
|
||||||
|
@ -53,9 +53,27 @@ private:
|
|||||||
TConstBonusListPtr getAllBonusesWithoutCaching(const CSelector &selector, const CSelector &limit, const CBonusSystemNode *root = nullptr) const;
|
TConstBonusListPtr getAllBonusesWithoutCaching(const CSelector &selector, const CSelector &limit, const CBonusSystemNode *root = nullptr) const;
|
||||||
std::shared_ptr<Bonus> getUpdatedBonus(const std::shared_ptr<Bonus> & b, const TUpdaterPtr & updater) const;
|
std::shared_ptr<Bonus> getUpdatedBonus(const std::shared_ptr<Bonus> & b, const TUpdaterPtr & updater) const;
|
||||||
|
|
||||||
|
void getRedParents(TNodes &out); //retrieves list of red parent nodes (nodes bonuses propagate from)
|
||||||
|
void getRedAncestors(TNodes &out);
|
||||||
|
void getRedChildren(TNodes &out);
|
||||||
|
|
||||||
|
void getAllParents(TCNodes & out) const;
|
||||||
|
|
||||||
|
void newChildAttached(CBonusSystemNode & child);
|
||||||
|
void childDetached(CBonusSystemNode & child);
|
||||||
|
void propagateBonus(const std::shared_ptr<Bonus> & b, const CBonusSystemNode & source);
|
||||||
|
void unpropagateBonus(const std::shared_ptr<Bonus> & b);
|
||||||
|
bool actsAsBonusSourceOnly() const;
|
||||||
|
|
||||||
|
void newRedDescendant(CBonusSystemNode & descendant); //propagation needed
|
||||||
|
void removedRedDescendant(CBonusSystemNode & descendant); //de-propagation needed
|
||||||
|
|
||||||
|
std::string nodeShortInfo() const;
|
||||||
|
|
||||||
|
void exportBonus(const std::shared_ptr<Bonus> & b);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CBonusSystemNode();
|
explicit CBonusSystemNode(bool isHypotetic = false);
|
||||||
explicit CBonusSystemNode(bool isHypotetic);
|
|
||||||
explicit CBonusSystemNode(ENodeTypes NodeType);
|
explicit CBonusSystemNode(ENodeTypes NodeType);
|
||||||
CBonusSystemNode(CBonusSystemNode && other) noexcept;
|
CBonusSystemNode(CBonusSystemNode && other) noexcept;
|
||||||
virtual ~CBonusSystemNode();
|
virtual ~CBonusSystemNode();
|
||||||
@ -68,11 +86,6 @@ public:
|
|||||||
|
|
||||||
//non-const interface
|
//non-const interface
|
||||||
void getParents(TNodes &out); //retrieves list of parent nodes (nodes to inherit bonuses from)
|
void getParents(TNodes &out); //retrieves list of parent nodes (nodes to inherit bonuses from)
|
||||||
|
|
||||||
void getRedParents(TNodes &out); //retrieves list of red parent nodes (nodes bonuses propagate from)
|
|
||||||
void getRedAncestors(TNodes &out);
|
|
||||||
void getRedChildren(TNodes &out);
|
|
||||||
void getAllParents(TCNodes & out) const;
|
|
||||||
static PlayerColor retrieveNodeOwner(const CBonusSystemNode * node);
|
static PlayerColor retrieveNodeOwner(const CBonusSystemNode * node);
|
||||||
std::shared_ptr<Bonus> getBonusLocalFirst(const CSelector & selector);
|
std::shared_ptr<Bonus> getBonusLocalFirst(const CSelector & selector);
|
||||||
|
|
||||||
@ -82,27 +95,18 @@ public:
|
|||||||
virtual void addNewBonus(const std::shared_ptr<Bonus>& b);
|
virtual void addNewBonus(const std::shared_ptr<Bonus>& b);
|
||||||
void accumulateBonus(const std::shared_ptr<Bonus>& b); //add value of bonus with same type/subtype or create new
|
void accumulateBonus(const std::shared_ptr<Bonus>& b); //add value of bonus with same type/subtype or create new
|
||||||
|
|
||||||
void newChildAttached(CBonusSystemNode & child);
|
|
||||||
void childDetached(CBonusSystemNode & child);
|
|
||||||
void propagateBonus(const std::shared_ptr<Bonus> & b, const CBonusSystemNode & source);
|
|
||||||
void unpropagateBonus(const std::shared_ptr<Bonus> & b);
|
|
||||||
void removeBonus(const std::shared_ptr<Bonus>& b);
|
void removeBonus(const std::shared_ptr<Bonus>& b);
|
||||||
void removeBonuses(const CSelector & selector);
|
void removeBonuses(const CSelector & selector);
|
||||||
void removeBonusesRecursive(const CSelector & s);
|
void removeBonusesRecursive(const CSelector & s);
|
||||||
void newRedDescendant(CBonusSystemNode & descendant); //propagation needed
|
|
||||||
void removedRedDescendant(CBonusSystemNode & descendant); //de-propagation needed
|
|
||||||
|
|
||||||
bool isIndependentNode() const; //node is independent when it has no parents nor children
|
bool isIndependentNode() const; //node is independent when it has no parents nor children
|
||||||
bool actsAsBonusSourceOnly() const;
|
|
||||||
///updates count of remaining turns and removes outdated bonuses by selector
|
///updates count of remaining turns and removes outdated bonuses by selector
|
||||||
void reduceBonusDurations(const CSelector &s);
|
void reduceBonusDurations(const CSelector &s);
|
||||||
virtual std::string bonusToString(const std::shared_ptr<Bonus>& bonus, bool description) const {return "";}; //description or bonus name
|
virtual std::string bonusToString(const std::shared_ptr<Bonus>& bonus, bool description) const {return "";}; //description or bonus name
|
||||||
virtual std::string nodeName() const;
|
virtual std::string nodeName() const;
|
||||||
virtual std::string nodeShortInfo() const;
|
|
||||||
bool isHypothetic() const { return isHypotheticNode; }
|
bool isHypothetic() const { return isHypotheticNode; }
|
||||||
|
|
||||||
void deserializationFix();
|
void deserializationFix();
|
||||||
void exportBonus(const std::shared_ptr<Bonus> & b);
|
|
||||||
void exportBonuses();
|
void exportBonuses();
|
||||||
|
|
||||||
const BonusList &getBonusList() const;
|
const BonusList &getBonusList() const;
|
||||||
@ -110,10 +114,10 @@ public:
|
|||||||
const BonusList & getExportedBonusList() const;
|
const BonusList & getExportedBonusList() const;
|
||||||
CBonusSystemNode::ENodeTypes getNodeType() const;
|
CBonusSystemNode::ENodeTypes getNodeType() const;
|
||||||
void setNodeType(CBonusSystemNode::ENodeTypes type);
|
void setNodeType(CBonusSystemNode::ENodeTypes type);
|
||||||
const TNodesVector &getParentNodes() const;
|
const TNodesVector & getParentNodes() const;
|
||||||
const TNodesVector &getChildrenNodes() const;
|
const TNodesVector & getChildrenNodes() const;
|
||||||
const std::string &getDescription() const;
|
const std::string & getDescription() const;
|
||||||
void setDescription(const std::string &description);
|
void setDescription(const std::string & description);
|
||||||
|
|
||||||
static void treeHasChanged();
|
static void treeHasChanged();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user