mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-03 13:01:33 +02:00
cleanup unused
This commit is contained in:
parent
f33dec9337
commit
ff278d5f3a
@ -38,53 +38,6 @@
|
||||
#include "../lib/mapObjects/CGHeroInstance.h"
|
||||
#include "../lib/NetPacksBase.h"
|
||||
|
||||
TConstBonusListPtr CHeroWithMaybePickedArtifact::getAllBonuses(const CSelector & selector, const CSelector & limit, const CBonusSystemNode * root, const std::string & cachingStr) const
|
||||
{
|
||||
TBonusListPtr out(new BonusList());
|
||||
TConstBonusListPtr heroBonuses = hero->getAllBonuses(selector, limit, hero, cachingStr);
|
||||
TConstBonusListPtr bonusesFromPickedUpArtifact;
|
||||
|
||||
const auto pickedArtInst = cww->getPickedArtifact();
|
||||
|
||||
if(pickedArtInst)
|
||||
bonusesFromPickedUpArtifact = pickedArtInst->getAllBonuses(selector, limit, hero);
|
||||
else
|
||||
bonusesFromPickedUpArtifact = TBonusListPtr(new BonusList());
|
||||
|
||||
for(const auto & b : *heroBonuses)
|
||||
out->push_back(b);
|
||||
|
||||
for(const auto & b : *bonusesFromPickedUpArtifact)
|
||||
*out -= b;
|
||||
return out;
|
||||
}
|
||||
|
||||
int64_t CHeroWithMaybePickedArtifact::getTreeVersion() const
|
||||
{
|
||||
return hero->getTreeVersion(); //this assumes that hero and artifact belongs to main bonus tree
|
||||
}
|
||||
|
||||
si32 CHeroWithMaybePickedArtifact::manaLimit() const
|
||||
{
|
||||
//TODO: reduplicate code with CGHeroInstance
|
||||
return si32(getPrimSkillLevel(PrimarySkill::KNOWLEDGE) * (valOfBonuses(BonusType::MANA_PER_KNOWLEDGE)));
|
||||
}
|
||||
|
||||
const IBonusBearer * CHeroWithMaybePickedArtifact::getBonusBearer() const
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
FactionID CHeroWithMaybePickedArtifact::getFaction() const
|
||||
{
|
||||
return hero->getFaction();
|
||||
}
|
||||
|
||||
CHeroWithMaybePickedArtifact::CHeroWithMaybePickedArtifact(CWindowWithArtifacts * Cww, const CGHeroInstance * Hero)
|
||||
: hero(Hero), cww(Cww)
|
||||
{
|
||||
}
|
||||
|
||||
void CHeroSwitcher::clickPressed(const Point & cursorPosition)
|
||||
{
|
||||
//TODO: do not recreate window
|
||||
|
@ -46,24 +46,6 @@ public:
|
||||
CHeroSwitcher(CHeroWindow * owner_, Point pos_, const CGHeroInstance * hero_);
|
||||
};
|
||||
|
||||
//helper class for calculating values of hero bonuses without bonuses from picked up artifact
|
||||
class CHeroWithMaybePickedArtifact : public IBonusBearer, public AFactionMember
|
||||
{
|
||||
public:
|
||||
const CGHeroInstance * hero;
|
||||
CWindowWithArtifacts * cww;
|
||||
|
||||
CHeroWithMaybePickedArtifact(CWindowWithArtifacts * Cww, const CGHeroInstance * Hero);
|
||||
TConstBonusListPtr getAllBonuses(const CSelector & selector, const CSelector & limit, const CBonusSystemNode * root = nullptr, const std::string & cachingStr = "") const override;
|
||||
|
||||
const IBonusBearer * getBonusBearer() const override;
|
||||
FactionID getFaction() const override;
|
||||
|
||||
int64_t getTreeVersion() const override;
|
||||
|
||||
si32 manaLimit() const;
|
||||
};
|
||||
|
||||
class CHeroWindow : public CStatusbarWindow, public CGarrisonHolder, public CWindowWithArtifacts
|
||||
{
|
||||
std::shared_ptr<CLabel> name;
|
||||
|
@ -247,18 +247,6 @@ public:
|
||||
class CCallback;
|
||||
class CExchangeWindow;
|
||||
|
||||
struct HeroArtifact
|
||||
{
|
||||
const CGHeroInstance * hero;
|
||||
const CArtifactInstance * artifact;
|
||||
ArtifactPosition artPosition;
|
||||
|
||||
HeroArtifact(const CGHeroInstance * hero, const CArtifactInstance * artifact, ArtifactPosition artPosition)
|
||||
:hero(hero), artifact(artifact), artPosition(artPosition)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class CExchangeController
|
||||
{
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user