Browse Source

cleanup unused

SoundSSGood 2 years ago
parent
commit
ff278d5f3a
3 changed files with 0 additions and 77 deletions
  1. 0 47
      client/windows/CHeroWindow.cpp
  2. 0 18
      client/windows/CHeroWindow.h
  3. 0 12
      client/windows/GUIClasses.h

+ 0 - 47
client/windows/CHeroWindow.cpp

@@ -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

+ 0 - 18
client/windows/CHeroWindow.h

@@ -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;

+ 0 - 12
client/windows/GUIClasses.h

@@ -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: