1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-18 03:21:27 +02:00

Remove unused method

This commit is contained in:
Ivan Savenko 2024-09-27 13:25:18 +00:00
parent bee2e7200c
commit 072aa8aadd
2 changed files with 5 additions and 16 deletions

View File

@ -95,16 +95,7 @@ std::vector<Component> CRewardableObject::loadComponents(const CGHeroInstance *
return result;
}
bool CRewardableObject::guardedPotentially() const
{
for (auto const & visitInfo : configuration.info)
if (!visitInfo.reward.guards.empty())
return true;
return false;
}
bool CRewardableObject::guardedPresently() const
bool CRewardableObject::isGuarded() const
{
return stacksCount() > 0;
}
@ -117,7 +108,7 @@ void CRewardableObject::onHeroVisit(const CGHeroInstance *hero) const
cb->sendAndApply(&cov);
}
if (guardedPresently())
if (isGuarded())
{
auto guardedIndexes = getAvailableRewards(hero, Rewardable::EEventType::EVENT_GUARDED);
auto guardedReward = configuration.info.at(guardedIndexes.at(0));
@ -236,7 +227,7 @@ void CRewardableObject::battleFinished(const CGHeroInstance *hero, const BattleR
void CRewardableObject::blockingDialogAnswered(const CGHeroInstance * hero, int32_t answer) const
{
if(guardedPresently())
if(isGuarded())
{
if (answer)
{
@ -410,7 +401,7 @@ std::vector<Component> CRewardableObject::getPopupComponentsImpl(PlayerColor pla
if (!wasScouted(player))
return {};
if (guardedPresently())
if (isGuarded())
{
if (!cb->getSettings().getBoolean(EGameSettings::BANKS_SHOW_GUARDS_COMPOSITION))
return {};

View File

@ -47,10 +47,8 @@ protected:
void doHeroVisit(const CGHeroInstance *h) const;
/// Returns true if this object might have guards present, whether they were cleared or not
bool guardedPotentially() const;
/// Returns true if this object is currently guarded
bool guardedPresently() const;
bool isGuarded() const;
public:
/// Visitability checks. Note that hero check includes check for hero owner (returns true if object was visited by player)