1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Support rewardable objects

This commit is contained in:
nordsoft
2022-09-14 22:51:19 +04:00
committed by Andrii Danylchenko
parent 5637cdbe3f
commit 7dc05d8e81
3 changed files with 35 additions and 4 deletions

View File

@@ -175,6 +175,12 @@ public:
}
};
namespace Rewardable
{
const std::array<std::string, 3> SelectModeString{"selectFirst", "selectPlayer", "selectRandom"};
const std::array<std::string, 5> VisitModeString{"unlimited", "once", "hero", "bonus", "player"};
}
/// Base class that can handle granting rewards to visiting heroes.
/// Inherits from CArmedInstance for proper trasfer of armies
class DLL_LINKAGE CRewardableObject : public CArmedInstance
@@ -256,6 +262,8 @@ public:
/// function that will be called once reward is fully granted to hero
virtual void onRewardGiven(const CGHeroInstance * hero) const;
void initObj(CRandomGenerator & rand) override;
CRewardableObject();