2023-06-08 16:29:29 +02:00
|
|
|
/*
|
|
|
|
* DwellingInstanceConstructor.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"
|
2024-02-11 23:09:01 +02:00
|
|
|
|
|
|
|
#include "../json/JsonNode.h"
|
2024-01-10 21:30:12 +02:00
|
|
|
#include "../mapObjects/CGDwelling.h"
|
2023-06-08 16:29:29 +02:00
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
class CGDwelling;
|
|
|
|
|
|
|
|
class DwellingInstanceConstructor : public CDefaultObjectTypeHandler<CGDwelling>
|
|
|
|
{
|
|
|
|
std::vector<std::vector<const CCreature *>> availableCreatures;
|
|
|
|
|
|
|
|
JsonNode guards;
|
2024-04-22 11:35:55 +02:00
|
|
|
bool bannedForRandomDwelling = false;
|
2023-06-08 16:29:29 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool objectFilter(const CGObjectInstance * obj, std::shared_ptr<const ObjectTemplate> tmpl) const override;
|
|
|
|
void initTypeData(const JsonNode & input) override;
|
|
|
|
|
|
|
|
public:
|
|
|
|
bool hasNameTextID() const override;
|
|
|
|
|
|
|
|
void initializeObject(CGDwelling * object) const override;
|
|
|
|
void randomizeObject(CGDwelling * object, CRandomGenerator & rng) const override;
|
|
|
|
|
2024-04-22 11:35:55 +02:00
|
|
|
bool isBannedForRandomDwelling() const;
|
2023-06-08 16:29:29 +02:00
|
|
|
bool producesCreature(const CCreature * crea) const;
|
|
|
|
std::vector<const CCreature *> getProducedCreatures() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|