1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Moved DwellingInstanceConstructor to a new file

This commit is contained in:
Ivan Savenko
2023-06-08 17:29:29 +03:00
parent 77b58bc66d
commit 58661fc8ec
9 changed files with 204 additions and 160 deletions

View File

@@ -9,18 +9,17 @@
*/
#pragma once
#include "AObjectTypeHandler.h"
#include "CDefaultObjectTypeHandler.h"
#include "../LogicalExpression.h"
#include "../mapObjects/MiscObjects.h"
VCMI_LIB_NAMESPACE_BEGIN
class CGArtifact;
class CGObjectInstance;
class CGTownInstance;
class CGHeroInstance;
class CGDwelling;
class CGMarket;
class CHeroClass;
class CBank;
@@ -82,33 +81,6 @@ public:
}
};
class CDwellingInstanceConstructor : public CDefaultObjectTypeHandler<CGDwelling>
{
std::vector<std::vector<const CCreature *>> availableCreatures;
JsonNode guards;
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;
bool producesCreature(const CCreature * crea) const;
std::vector<const CCreature *> getProducedCreatures() const;
template <typename Handler> void serialize(Handler &h, const int version)
{
h & availableCreatures;
h & guards;
h & static_cast<CDefaultObjectTypeHandler<CGDwelling>&>(*this);
}
};
class DLL_LINKAGE BoatInstanceConstructor : public CDefaultObjectTypeHandler<CGBoat>
{
protected: