1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
vcmi/lib/mapObjectConstructors/FlaggableInstanceConstructor.h
Ivan Savenko 8a5ac73438 Basic support for configurable flaggable objects
Converted CGLighthouse class into FlaggableMapObject

Bonus provided by Lighthouse/Flaggable is now defined in config and is
accessible to mods.
2024-10-25 16:48:10 +00:00

35 lines
914 B
C++

/*
* FlaggableInstanceConstructor.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
#include "CDefaultObjectTypeHandler.h"
#include "../bonuses/Bonus.h"
#include "../mapObjects/FlaggableMapObject.h"
VCMI_LIB_NAMESPACE_BEGIN
class FlaggableInstanceConstructor final : public CDefaultObjectTypeHandler<FlaggableMapObject>
{
std::vector<std::shared_ptr<Bonus>> providedBonuses;
/// ID of message to show on hero visit
std::string visitMessageTextID;
protected:
void initTypeData(const JsonNode & config) override;
void initializeObject(FlaggableMapObject * object) const override;
public:
const std::string & getVisitMessageTextID() const;
const std::vector<std::shared_ptr<Bonus>> & getProvidedBonuses() const;
};
VCMI_LIB_NAMESPACE_END