ObjectInfo.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 "../mapObjects/CompoundMapObjectID.h"
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. struct CompoundMapObjectID;
  15. class CGObjectInstance;
  16. struct DLL_LINKAGE ObjectInfo
  17. {
  18. ObjectInfo(si32 ID, si32 subID);
  19. ObjectInfo(CompoundMapObjectID id);
  20. ObjectInfo(const ObjectInfo & other);
  21. ObjectInfo & operator=(const ObjectInfo & other);
  22. std::vector<std::shared_ptr<const ObjectTemplate>> templates;
  23. si32 primaryID;
  24. si32 secondaryID;
  25. ui32 value = 0;
  26. ui16 probability = 0;
  27. ui32 maxPerZone = 1;
  28. //ui32 maxPerMap; //unused
  29. std::function<std::shared_ptr<CGObjectInstance>()> generateObject;
  30. std::function<void(CGObjectInstance &)> destroyObject;
  31. void setAllTemplates(MapObjectID type, MapObjectSubID subtype);
  32. void setTemplates(MapObjectID type, MapObjectSubID subtype, TerrainId terrain);
  33. CompoundMapObjectID getCompoundID() const;
  34. //bool matchesId(const CompoundMapObjectID & id) const;
  35. };
  36. VCMI_LIB_NAMESPACE_END