mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
All pointers held by bonus itself are now const. To support OppositeSideLimiter (the only stateful limiter) bonuses now hold their player owner instead. No changes in functionality or mods
53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
/*
|
|
* 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
|
|
|
|
bool IPropagator::shouldBeAttached(CBonusSystemNode *dest) const
|
|
{
|
|
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;
|
|
}
|
|
|
|
bool CPropagatorNodeType::shouldBeAttached(CBonusSystemNode *dest) const
|
|
{
|
|
return nodeType == dest->getNodeType();
|
|
}
|
|
|
|
VCMI_LIB_NAMESPACE_END
|