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:
committed by
Andrii Danylchenko
parent
5637cdbe3f
commit
7dc05d8e81
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user