CBonusProxy.h 794 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * CBonusProxy.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 "BonusSelector.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. class DLL_LINKAGE CCheckProxy
  14. {
  15. public:
  16. CCheckProxy(const IBonusBearer * Target, CSelector Selector, const std::string & cachingStr);
  17. CCheckProxy(const IBonusBearer * Target, BonusType bonusType);
  18. CCheckProxy(const CCheckProxy & other);
  19. CCheckProxy& operator= (const CCheckProxy & other) = default;
  20. bool getHasBonus() const;
  21. private:
  22. const IBonusBearer * target;
  23. std::string cachingStr;
  24. CSelector selector;
  25. mutable int64_t cachedLast;
  26. mutable bool hasBonus;
  27. };
  28. VCMI_LIB_NAMESPACE_END