DwellingInstanceConstructor.h 1010 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. VCMI_LIB_NAMESPACE_BEGIN
  13. class CGDwelling;
  14. class DwellingInstanceConstructor : public CDefaultObjectTypeHandler<CGDwelling>
  15. {
  16. std::vector<std::vector<const CCreature *>> availableCreatures;
  17. JsonNode guards;
  18. protected:
  19. bool objectFilter(const CGObjectInstance * obj, std::shared_ptr<const ObjectTemplate> tmpl) const override;
  20. void initTypeData(const JsonNode & input) override;
  21. public:
  22. bool hasNameTextID() const override;
  23. void initializeObject(CGDwelling * object) const override;
  24. void randomizeObject(CGDwelling * object, CRandomGenerator & rng) const override;
  25. bool producesCreature(const CCreature * crea) const;
  26. std::vector<const CCreature *> getProducedCreatures() const;
  27. };
  28. VCMI_LIB_NAMESPACE_END