DwellingInstanceConstructor.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * DwellingInstanceConstructor.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "CDefaultObjectTypeHandler.h"
  12. #include "../mapObjects/CGDwelling.h"
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. class CGDwelling;
  15. class DwellingInstanceConstructor : public CDefaultObjectTypeHandler<CGDwelling>
  16. {
  17. std::vector<std::vector<const CCreature *>> availableCreatures;
  18. JsonNode guards;
  19. protected:
  20. bool objectFilter(const CGObjectInstance * obj, std::shared_ptr<const ObjectTemplate> tmpl) const override;
  21. void initTypeData(const JsonNode & input) override;
  22. public:
  23. bool hasNameTextID() const override;
  24. void initializeObject(CGDwelling * object) const override;
  25. void randomizeObject(CGDwelling * object, CRandomGenerator & rng) const override;
  26. bool producesCreature(const CCreature * crea) const;
  27. std::vector<const CCreature *> getProducedCreatures() const;
  28. };
  29. VCMI_LIB_NAMESPACE_END