|
|
@@ -22,7 +22,7 @@ VCMI_LIB_NAMESPACE_BEGIN
|
|
|
namespace Rewardable
|
|
|
{
|
|
|
|
|
|
-enum EVisitMode
|
|
|
+enum EVisitMode : uint8_t
|
|
|
{
|
|
|
VISIT_UNLIMITED, // any number of times. Side effect - object hover text won't contain visited/not visited text
|
|
|
VISIT_ONCE, // only once, first to visit get all the rewards
|
|
|
@@ -34,7 +34,7 @@ enum EVisitMode
|
|
|
};
|
|
|
|
|
|
/// controls selection of reward granted to player
|
|
|
-enum ESelectMode
|
|
|
+enum ESelectMode : uint8_t
|
|
|
{
|
|
|
SELECT_FIRST, // first reward that matches limiters
|
|
|
SELECT_PLAYER, // player can select from all allowed rewards
|
|
|
@@ -42,7 +42,7 @@ enum ESelectMode
|
|
|
SELECT_ALL // grant all rewards that match limiters
|
|
|
};
|
|
|
|
|
|
-enum class EEventType
|
|
|
+enum class EEventType : uint8_t
|
|
|
{
|
|
|
EVENT_INVALID = 0,
|
|
|
EVENT_FIRST_VISIT,
|
|
|
@@ -52,7 +52,7 @@ enum class EEventType
|
|
|
};
|
|
|
|
|
|
constexpr std::array<std::string_view, 4> SelectModeString{"selectFirst", "selectPlayer", "selectRandom", "selectAll"};
|
|
|
-constexpr std::array<std::string_view, 6> VisitModeString{"unlimited", "once", "hero", "bonus", "limiter", "player"};
|
|
|
+constexpr std::array<std::string_view, 7> VisitModeString{"unlimited", "once", "hero", "bonus", "limiter", "player", "playerGlobal" };
|
|
|
|
|
|
struct DLL_LINKAGE ResetInfo
|
|
|
{
|
|
|
@@ -150,10 +150,10 @@ struct DLL_LINKAGE Configuration
|
|
|
std::vector<Rewardable::VisitInfo> info;
|
|
|
|
|
|
/// how reward will be selected, uses ESelectMode enum
|
|
|
- ui8 selectMode = Rewardable::SELECT_FIRST;
|
|
|
+ ESelectMode selectMode = Rewardable::SELECT_FIRST;
|
|
|
|
|
|
/// controls who can visit an object, uses EVisitMode enum
|
|
|
- ui8 visitMode = Rewardable::VISIT_UNLIMITED;
|
|
|
+ EVisitMode visitMode = Rewardable::VISIT_UNLIMITED;
|
|
|
|
|
|
/// how and when should the object be reset
|
|
|
Rewardable::ResetInfo resetParameters;
|