diff --git a/client/widgets/MiscWidgets.cpp b/client/widgets/MiscWidgets.cpp index f54d72aad..8c6403934 100644 --- a/client/widgets/MiscWidgets.cpp +++ b/client/widgets/MiscWidgets.cpp @@ -372,7 +372,7 @@ CTownTooltip::CTownTooltip(Point pos, const CGTownInstance * town) init(InfoAboutTown(town, true)); } -void MoraleLuckBox::set(const IFactionMember * node) +void MoraleLuckBox::set(const AFactionMember * node) { OBJECT_CONSTRUCTION_CUSTOM_CAPTURING(255-DISPOSE); diff --git a/client/widgets/MiscWidgets.h b/client/widgets/MiscWidgets.h index 7de03937b..990663b2b 100644 --- a/client/widgets/MiscWidgets.h +++ b/client/widgets/MiscWidgets.h @@ -16,7 +16,7 @@ VCMI_LIB_NAMESPACE_BEGIN class CGGarrison; struct InfoAboutArmy; class CArmedInstance; -class IFactionMember; +class AFactionMember; VCMI_LIB_NAMESPACE_END @@ -170,7 +170,7 @@ public: bool morale; //true if morale, false if luck bool small; - void set(const IFactionMember *node); + void set(const AFactionMember *node); MoraleLuckBox(bool Morale, const Rect &r, bool Small=false); }; diff --git a/client/windows/CHeroWindow.h b/client/windows/CHeroWindow.h index 7284e8769..e2f9f1343 100644 --- a/client/windows/CHeroWindow.h +++ b/client/windows/CHeroWindow.h @@ -47,7 +47,7 @@ public: }; //helper class for calculating values of hero bonuses without bonuses from picked up artifact -class CHeroWithMaybePickedArtifact : public IBonusBearer, public IFactionMember +class CHeroWithMaybePickedArtifact : public IBonusBearer, public AFactionMember { public: const CGHeroInstance * hero; diff --git a/include/vcmi/Creature.h b/include/vcmi/Creature.h index 967283ac7..5074b459b 100644 --- a/include/vcmi/Creature.h +++ b/include/vcmi/Creature.h @@ -19,7 +19,7 @@ class ResourceSet; enum class EGameResID : int8_t; /// Base class for creatures and battle stacks -class DLL_LINKAGE ICreature: public IFactionMember +class DLL_LINKAGE ACreature: public AFactionMember { public: bool isLiving() const; //non-undead, non-non living or alive @@ -28,7 +28,7 @@ public: }; template -class DLL_LINKAGE CreatureEntity : public EntityT, public ICreature +class DLL_LINKAGE CreatureEntity : public EntityT, public ACreature { }; diff --git a/include/vcmi/FactionMember.h b/include/vcmi/FactionMember.h index 12b0fd3ff..394641917 100644 --- a/include/vcmi/FactionMember.h +++ b/include/vcmi/FactionMember.h @@ -21,7 +21,7 @@ namespace PrimarySkill enum PrimarySkill : int8_t; } -class DLL_LINKAGE IFactionMember: public IConstBonusProvider, public INativeTerrainProvider +class DLL_LINKAGE AFactionMember: public IConstBonusProvider, public INativeTerrainProvider { public: /** diff --git a/lib/BasicTypes.cpp b/lib/BasicTypes.cpp index 47f634df0..011d36f4d 100644 --- a/lib/BasicTypes.cpp +++ b/lib/BasicTypes.cpp @@ -27,7 +27,7 @@ bool INativeTerrainProvider::isNativeTerrain(TerrainId terrain) const return native == terrain || native == ETerrainId::ANY_TERRAIN; } -TerrainId IFactionMember::getNativeTerrain() const +TerrainId AFactionMember::getNativeTerrain() const { constexpr auto any = TerrainId(ETerrainId::ANY_TERRAIN); const std::string cachingStringNoTerrainPenalty = "type_NO_TERRAIN_PENALTY_sANY"; @@ -39,14 +39,14 @@ TerrainId IFactionMember::getNativeTerrain() const ? any : VLC->factions()->getById(getFaction())->getNativeTerrain(); } -int32_t IFactionMember::magicResistance() const +int32_t AFactionMember::magicResistance() const { si32 val = getBonusBearer()->valOfBonuses(Selector::type()(Bonus::MAGIC_RESISTANCE)); vstd::amin (val, 100); return val; } -int IFactionMember::getAttack(bool ranged) const +int AFactionMember::getAttack(bool ranged) const { const std::string cachingStr = "type_PRIMARY_SKILLs_ATTACK"; @@ -55,7 +55,7 @@ int IFactionMember::getAttack(bool ranged) const return getBonusBearer()->valOfBonuses(selector, cachingStr); } -int IFactionMember::getDefense(bool ranged) const +int AFactionMember::getDefense(bool ranged) const { const std::string cachingStr = "type_PRIMARY_SKILLs_DEFENSE"; @@ -64,21 +64,21 @@ int IFactionMember::getDefense(bool ranged) const return getBonusBearer()->valOfBonuses(selector, cachingStr); } -int IFactionMember::getMinDamage(bool ranged) const +int AFactionMember::getMinDamage(bool ranged) const { const std::string cachingStr = "type_CREATURE_DAMAGEs_0Otype_CREATURE_DAMAGEs_1"; static const auto selector = Selector::typeSubtype(Bonus::CREATURE_DAMAGE, 0).Or(Selector::typeSubtype(Bonus::CREATURE_DAMAGE, 1)); return getBonusBearer()->valOfBonuses(selector, cachingStr); } -int IFactionMember::getMaxDamage(bool ranged) const +int AFactionMember::getMaxDamage(bool ranged) const { const std::string cachingStr = "type_CREATURE_DAMAGEs_0Otype_CREATURE_DAMAGEs_2"; static const auto selector = Selector::typeSubtype(Bonus::CREATURE_DAMAGE, 0).Or(Selector::typeSubtype(Bonus::CREATURE_DAMAGE, 2)); return getBonusBearer()->valOfBonuses(selector, cachingStr); } -int IFactionMember::getPrimSkillLevel(PrimarySkill::PrimarySkill id) const +int AFactionMember::getPrimSkillLevel(PrimarySkill::PrimarySkill id) const { static const CSelector selectorAllSkills = Selector::type()(Bonus::PRIMARY_SKILL); static const std::string keyAllSkills = "type_PRIMARY_SKILL"; @@ -88,12 +88,12 @@ int IFactionMember::getPrimSkillLevel(PrimarySkill::PrimarySkill id) const return std::max(ret, minSkillValue); //otherwise, some artifacts may cause negative skill value effect, sp=0 works in old saves } -int IFactionMember::MoraleValAndBonusList(TConstBonusListPtr & bonusList) const +int AFactionMember::MoraleValAndBonusList(TConstBonusListPtr & bonusList) const { static const auto unaffectedByMoraleSelector = Selector::type()(Bonus::NON_LIVING).Or(Selector::type()(Bonus::UNDEAD)) .Or(Selector::type()(Bonus::SIEGE_WEAPON)).Or(Selector::type()(Bonus::NO_MORALE)); - static const std::string cachingStrUn = "IFactionMember::unaffectedByMoraleSelector"; + static const std::string cachingStrUn = "AFactionMember::unaffectedByMoraleSelector"; auto unaffected = getBonusBearer()->hasBonus(unaffectedByMoraleSelector, cachingStrUn); if(unaffected) { @@ -109,7 +109,7 @@ int IFactionMember::MoraleValAndBonusList(TConstBonusListPtr & bonusList) const return std::clamp(bonusList->totalValue(), -3, +3); } -int IFactionMember::LuckValAndBonusList(TConstBonusListPtr & bonusList) const +int AFactionMember::LuckValAndBonusList(TConstBonusListPtr & bonusList) const { if(getBonusBearer()->hasBonusOfType(Bonus::NO_LUCK)) { @@ -125,19 +125,19 @@ int IFactionMember::LuckValAndBonusList(TConstBonusListPtr & bonusList) const return std::clamp(bonusList->totalValue(), -3, +3); } -int IFactionMember::MoraleVal() const +int AFactionMember::MoraleVal() const { TConstBonusListPtr tmp = nullptr; return MoraleValAndBonusList(tmp); } -int IFactionMember::LuckVal() const +int AFactionMember::LuckVal() const { TConstBonusListPtr tmp = nullptr; return LuckValAndBonusList(tmp); } -ui32 ICreature::MaxHealth() const +ui32 ACreature::MaxHealth() const { const std::string cachingStr = "type_STACK_HEALTH"; static const auto selector = Selector::type()(Bonus::STACK_HEALTH); @@ -145,7 +145,7 @@ ui32 ICreature::MaxHealth() const return std::max(1, value); //never 0 } -ui32 ICreature::Speed(int turn, bool useBind) const +ui32 ACreature::Speed(int turn, bool useBind) const { //war machines cannot move if(getBonusBearer()->hasBonus(Selector::type()(Bonus::SIEGE_WEAPON).And(Selector::turns(turn)))) @@ -161,9 +161,9 @@ ui32 ICreature::Speed(int turn, bool useBind) const return getBonusBearer()->valOfBonuses(Selector::type()(Bonus::STACKS_SPEED).And(Selector::turns(turn))); } -bool ICreature::isLiving() const //TODO: theoreticaly there exists "LIVING" bonus in stack experience documentation +bool ACreature::isLiving() const //TODO: theoreticaly there exists "LIVING" bonus in stack experience documentation { - static const std::string cachingStr = "ICreature::isLiving"; + static const std::string cachingStr = "ACreature::isLiving"; static const CSelector selector = Selector::type()(Bonus::UNDEAD) .Or(Selector::type()(Bonus::NON_LIVING)) .Or(Selector::type()(Bonus::GARGOYLE)) diff --git a/lib/CCreatureSet.h b/lib/CCreatureSet.h index 8014ed839..75af51012 100644 --- a/lib/CCreatureSet.h +++ b/lib/CCreatureSet.h @@ -64,7 +64,7 @@ public: void serializeJson(JsonSerializeFormat & handler); }; -class DLL_LINKAGE CStackInstance : public CBonusSystemNode, public CStackBasicDescriptor, public CArtifactSet, public ICreature +class DLL_LINKAGE CStackInstance : public CBonusSystemNode, public CStackBasicDescriptor, public CArtifactSet, public ACreature { protected: const CArmedInstance *_armyObj; //stack must be part of some army, army must be part of some object diff --git a/lib/CStack.cpp b/lib/CStack.cpp index a7b68207c..98c3502d9 100644 --- a/lib/CStack.cpp +++ b/lib/CStack.cpp @@ -89,7 +89,7 @@ ui32 CStack::level() const si32 CStack::magicResistance() const { - auto magicResistance = IFactionMember::magicResistance(); + auto magicResistance = AFactionMember::magicResistance(); si32 auraBonus = 0; diff --git a/lib/battle/Unit.h b/lib/battle/Unit.h index daf78e322..bf6c72a67 100644 --- a/lib/battle/Unit.h +++ b/lib/battle/Unit.h @@ -41,7 +41,7 @@ namespace BattlePhases class CUnitState; -class DLL_LINKAGE Unit : public IUnitInfo, public spells::Caster, public virtual IBonusBearer, public ICreature +class DLL_LINKAGE Unit : public IUnitInfo, public spells::Caster, public virtual IBonusBearer, public ACreature { public: virtual ~Unit(); diff --git a/lib/mapObjects/CGHeroInstance.h b/lib/mapObjects/CGHeroInstance.h index 58cc1c529..007adc0ed 100644 --- a/lib/mapObjects/CGHeroInstance.h +++ b/lib/mapObjects/CGHeroInstance.h @@ -41,7 +41,7 @@ public: }; -class DLL_LINKAGE CGHeroInstance : public CArmedInstance, public IBoatGenerator, public CArtifactSet, public spells::Caster, public IFactionMember +class DLL_LINKAGE CGHeroInstance : public CArmedInstance, public IBoatGenerator, public CArtifactSet, public spells::Caster, public AFactionMember { // We serialize heroes into JSON for crossover friend class CCampaignState; diff --git a/scripting/lua/api/battle/UnitProxy.cpp b/scripting/lua/api/battle/UnitProxy.cpp index 66500444f..161def4d2 100644 --- a/scripting/lua/api/battle/UnitProxy.cpp +++ b/scripting/lua/api/battle/UnitProxy.cpp @@ -29,10 +29,10 @@ VCMI_REGISTER_SCRIPT_API(UnitProxy, "battle.Unit") const std::vector UnitProxy::REGISTER_CUSTOM = { - {"getMinDamage", LuaMethodWrapper::invoke, false}, - {"getMaxDamage", LuaMethodWrapper::invoke, false}, - {"getAttack", LuaMethodWrapper::invoke, false}, - {"getDefense", LuaMethodWrapper::invoke, false}, + {"getMinDamage", LuaMethodWrapper::invoke, false}, + {"getMaxDamage", LuaMethodWrapper::invoke, false}, + {"getAttack", LuaMethodWrapper::invoke, false}, + {"getDefense", LuaMethodWrapper::invoke, false}, {"isAlive", LuaMethodWrapper::invoke, false}, {"unitId", LuaMethodWrapper::invoke, false}, };