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:
parent
bee2e7200c
commit
072aa8aadd
@ -95,16 +95,7 @@ std::vector<Component> CRewardableObject::loadComponents(const CGHeroInstance *
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CRewardableObject::guardedPotentially() const
|
bool CRewardableObject::isGuarded() const
|
||||||
{
|
|
||||||
for (auto const & visitInfo : configuration.info)
|
|
||||||
if (!visitInfo.reward.guards.empty())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CRewardableObject::guardedPresently() const
|
|
||||||
{
|
{
|
||||||
return stacksCount() > 0;
|
return stacksCount() > 0;
|
||||||
}
|
}
|
||||||
@ -117,7 +108,7 @@ void CRewardableObject::onHeroVisit(const CGHeroInstance *hero) const
|
|||||||
cb->sendAndApply(&cov);
|
cb->sendAndApply(&cov);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guardedPresently())
|
if (isGuarded())
|
||||||
{
|
{
|
||||||
auto guardedIndexes = getAvailableRewards(hero, Rewardable::EEventType::EVENT_GUARDED);
|
auto guardedIndexes = getAvailableRewards(hero, Rewardable::EEventType::EVENT_GUARDED);
|
||||||
auto guardedReward = configuration.info.at(guardedIndexes.at(0));
|
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
|
void CRewardableObject::blockingDialogAnswered(const CGHeroInstance * hero, int32_t answer) const
|
||||||
{
|
{
|
||||||
if(guardedPresently())
|
if(isGuarded())
|
||||||
{
|
{
|
||||||
if (answer)
|
if (answer)
|
||||||
{
|
{
|
||||||
@ -410,7 +401,7 @@ std::vector<Component> CRewardableObject::getPopupComponentsImpl(PlayerColor pla
|
|||||||
if (!wasScouted(player))
|
if (!wasScouted(player))
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
if (guardedPresently())
|
if (isGuarded())
|
||||||
{
|
{
|
||||||
if (!cb->getSettings().getBoolean(EGameSettings::BANKS_SHOW_GUARDS_COMPOSITION))
|
if (!cb->getSettings().getBoolean(EGameSettings::BANKS_SHOW_GUARDS_COMPOSITION))
|
||||||
return {};
|
return {};
|
||||||
|
@ -47,10 +47,8 @@ protected:
|
|||||||
|
|
||||||
void doHeroVisit(const CGHeroInstance *h) const;
|
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
|
/// Returns true if this object is currently guarded
|
||||||
bool guardedPresently() const;
|
bool isGuarded() const;
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/// Visitability checks. Note that hero check includes check for hero owner (returns true if object was visited by player)
|
/// Visitability checks. Note that hero check includes check for hero owner (returns true if object was visited by player)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user