CRandomRewardObjectInfo.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * CRandomRewardObjectInfo.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 "../JsonNode.h"
  12. #include "CObjectClassesHandler.h"
  13. #include "Rewardable.h"
  14. VCMI_LIB_NAMESPACE_BEGIN
  15. class CRandomGenerator;
  16. class DLL_LINKAGE CRandomRewardObjectInfo : public IObjectInfo
  17. {
  18. JsonNode parameters;
  19. void configureRewards(Rewardable::Configuration & object, CRandomGenerator & rng, const JsonNode & source, std::map<si32, si32> & thrownDice, CRewardVisitInfo::ERewardEventType mode) const;
  20. void configureLimiter(Rewardable::Configuration & object, CRandomGenerator & rng, CRewardLimiter & limiter, const JsonNode & source) const;
  21. TRewardLimitersList configureSublimiters(Rewardable::Configuration & object, CRandomGenerator & rng, const JsonNode & source) const;
  22. void configureReward(Rewardable::Configuration & object, CRandomGenerator & rng, CRewardInfo & info, const JsonNode & source) const;
  23. void configureResetInfo(Rewardable::Configuration & object, CRandomGenerator & rng, CRewardResetInfo & info, const JsonNode & source) const;
  24. public:
  25. const JsonNode & getParameters() const;
  26. bool givesResources() const override;
  27. bool givesExperience() const override;
  28. bool givesMana() const override;
  29. bool givesMovement() const override;
  30. bool givesPrimarySkills() const override;
  31. bool givesSecondarySkills() const override;
  32. bool givesArtifacts() const override;
  33. bool givesCreatures() const override;
  34. bool givesSpells() const override;
  35. bool givesBonuses() const override;
  36. void configureObject(Rewardable::Configuration & object, CRandomGenerator & rng) const;
  37. void init(const JsonNode & objectConfig);
  38. template <typename Handler> void serialize(Handler &h, const int version)
  39. {
  40. h & parameters;
  41. }
  42. };
  43. VCMI_LIB_NAMESPACE_END