|
|
@@ -11,6 +11,7 @@
|
|
|
|
|
|
#include "../constants/EntityIdentifiers.h"
|
|
|
#include "../constants/VariantIdentifier.h"
|
|
|
+#include "BonusEnum.h"
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
|
@@ -77,7 +78,27 @@ public:
|
|
|
static BonusCustomSubtype creatureLevel(int level);
|
|
|
};
|
|
|
|
|
|
-using BonusSubtypeID = VariantIdentifier<BonusCustomSubtype, SpellID, CreatureID, PrimarySkill, TerrainId, GameResID, SpellSchool>;
|
|
|
+class DLL_LINKAGE BonusTypeID : public EntityIdentifier<BonusTypeID>
|
|
|
+{
|
|
|
+public:
|
|
|
+ using EntityIdentifier<BonusTypeID>::EntityIdentifier;
|
|
|
+ using EnumType = BonusType;
|
|
|
+
|
|
|
+ static std::string encode(int32_t index);
|
|
|
+ static si32 decode(const std::string & identifier);
|
|
|
+
|
|
|
+ constexpr EnumType toEnum() const
|
|
|
+ {
|
|
|
+ return static_cast<EnumType>(EntityIdentifier::num);
|
|
|
+ }
|
|
|
+
|
|
|
+ constexpr BonusTypeID(const EnumType & enumValue)
|
|
|
+ {
|
|
|
+ EntityIdentifier::num = static_cast<int32_t>(enumValue);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+using BonusSubtypeID = VariantIdentifier<BonusCustomSubtype, SpellID, CreatureID, PrimarySkill, TerrainId, GameResID, SpellSchool, BonusTypeID>;
|
|
|
using BonusSourceID = VariantIdentifier<BonusCustomSource, SpellID, CreatureID, ArtifactID, ArtifactInstanceID, CampaignScenarioID, SecondarySkill, HeroTypeID, Obj, ObjectInstanceID, BuildingTypeUniqueID, BattleField>;
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|