2023-04-30 16:35:15 +02:00
|
|
|
/*
|
|
|
|
* Propagators.h, 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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2023-05-01 19:29:53 +02:00
|
|
|
#include "Bonus.h"
|
2023-04-30 16:35:15 +02:00
|
|
|
#include "CBonusSystemNode.h"
|
|
|
|
|
2024-05-07 21:17:05 +02:00
|
|
|
#include "../serializer/Serializeable.h"
|
|
|
|
|
2023-04-30 16:35:15 +02:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
extern DLL_LINKAGE const std::map<std::string, TPropagatorPtr> bonusPropagatorMap;
|
|
|
|
|
2024-05-07 21:17:05 +02:00
|
|
|
class DLL_LINKAGE IPropagator : public Serializeable
|
2023-04-30 16:35:15 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~IPropagator() = default;
|
|
|
|
virtual bool shouldBeAttached(CBonusSystemNode *dest);
|
|
|
|
virtual CBonusSystemNode::ENodeTypes getPropagatorType() const;
|
|
|
|
|
2024-01-20 20:34:51 +02:00
|
|
|
template <typename Handler> void serialize(Handler &h)
|
2023-04-30 16:35:15 +02:00
|
|
|
{}
|
|
|
|
};
|
|
|
|
|
|
|
|
class DLL_LINKAGE CPropagatorNodeType : public IPropagator
|
|
|
|
{
|
|
|
|
CBonusSystemNode::ENodeTypes nodeType;
|
|
|
|
|
|
|
|
public:
|
|
|
|
CPropagatorNodeType(CBonusSystemNode::ENodeTypes NodeType = CBonusSystemNode::ENodeTypes::UNKNOWN);
|
|
|
|
bool shouldBeAttached(CBonusSystemNode *dest) override;
|
|
|
|
CBonusSystemNode::ENodeTypes getPropagatorType() const override;
|
|
|
|
|
2024-01-20 20:34:51 +02:00
|
|
|
template <typename Handler> void serialize(Handler &h)
|
2023-04-30 16:35:15 +02:00
|
|
|
{
|
|
|
|
h & nodeType;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2024-05-07 21:17:05 +02:00
|
|
|
VCMI_LIB_NAMESPACE_END
|