2023-04-30 17:35:15 +03:00
|
|
|
/*
|
|
|
|
|
* Propagators.cpp, part of VCMI engine
|
|
|
|
|
*
|
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
|
*
|
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "StdInc.h"
|
|
|
|
|
|
|
|
|
|
#include "Propagators.h"
|
|
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
|
|
const std::map<std::string, TPropagatorPtr> bonusPropagatorMap =
|
|
|
|
|
{
|
|
|
|
|
{"BATTLE_WIDE", std::make_shared<CPropagatorNodeType>(CBonusSystemNode::BATTLE)},
|
|
|
|
|
{"VISITED_TOWN_AND_VISITOR", std::make_shared<CPropagatorNodeType>(CBonusSystemNode::TOWN_AND_VISITOR)},
|
|
|
|
|
{"PLAYER_PROPAGATOR", std::make_shared<CPropagatorNodeType>(CBonusSystemNode::PLAYER)},
|
|
|
|
|
{"HERO", std::make_shared<CPropagatorNodeType>(CBonusSystemNode::HERO)},
|
|
|
|
|
{"TEAM_PROPAGATOR", std::make_shared<CPropagatorNodeType>(CBonusSystemNode::TEAM)}, //untested
|
|
|
|
|
{"GLOBAL_EFFECT", std::make_shared<CPropagatorNodeType>(CBonusSystemNode::GLOBAL_EFFECTS)}
|
|
|
|
|
}; //untested
|
|
|
|
|
|
2025-06-03 19:23:40 +03:00
|
|
|
bool IPropagator::shouldBeAttached(CBonusSystemNode *dest) const
|
2023-04-30 17:35:15 +03:00
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CBonusSystemNode::ENodeTypes IPropagator::getPropagatorType() const
|
|
|
|
|
{
|
|
|
|
|
return CBonusSystemNode::ENodeTypes::NONE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CPropagatorNodeType::CPropagatorNodeType(CBonusSystemNode::ENodeTypes NodeType)
|
|
|
|
|
: nodeType(NodeType)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CBonusSystemNode::ENodeTypes CPropagatorNodeType::getPropagatorType() const
|
|
|
|
|
{
|
|
|
|
|
return nodeType;
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-03 19:23:40 +03:00
|
|
|
bool CPropagatorNodeType::shouldBeAttached(CBonusSystemNode *dest) const
|
2023-04-30 17:35:15 +03:00
|
|
|
{
|
|
|
|
|
return nodeType == dest->getNodeType();
|
|
|
|
|
}
|
|
|
|
|
|
2025-06-03 19:23:40 +03:00
|
|
|
VCMI_LIB_NAMESPACE_END
|