DwellingInstanceConstructor.h 1.1 KB

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