ObjectInfo.h 974 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * ObjectInfo.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 "../mapObjects/ObjectTemplate.h"
  12. #include "../constants/EntityIdentifiers.h"
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. struct CompoundMapObjectID;
  15. class CGObjectInstance;
  16. struct DLL_LINKAGE ObjectInfo
  17. {
  18. ObjectInfo();
  19. ObjectInfo(const ObjectInfo & other);
  20. ObjectInfo & operator=(const ObjectInfo & other);
  21. std::vector<std::shared_ptr<const ObjectTemplate>> templates;
  22. ui32 value = 0;
  23. ui16 probability = 0;
  24. ui32 maxPerZone = 1;
  25. //ui32 maxPerMap; //unused
  26. std::function<CGObjectInstance *()> generateObject;
  27. std::function<void(CGObjectInstance *)> destroyObject;
  28. void setTemplates(MapObjectID type, MapObjectSubID subtype, TerrainId terrain);
  29. //bool matchesId(const CompoundMapObjectID & id) const;
  30. };
  31. VCMI_LIB_NAMESPACE_END