HeroExchange.cpp 888 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * HeroExchange.cpp, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #include "StdInc.h"
  11. #include "HeroExchange.h"
  12. #include "../VCAI.h"
  13. #include "../Engine/Nullkiller.h"
  14. #include "../AIUtility.h"
  15. #include "../Analyzers/ArmyManager.h"
  16. extern boost::thread_specific_ptr<CCallback> cb;
  17. extern boost::thread_specific_ptr<VCAI> ai;
  18. using namespace Goals;
  19. bool HeroExchange::operator==(const HeroExchange & other) const
  20. {
  21. return false;
  22. }
  23. std::string HeroExchange::toString() const
  24. {
  25. return "Hero exchange " + exchangePath.toString();
  26. }
  27. uint64_t HeroExchange::getReinforcementArmyStrength() const
  28. {
  29. uint64_t armyValue = ai->nullkiller->armyManager->howManyReinforcementsCanGet(hero.get(), exchangePath.heroArmy);
  30. return armyValue;
  31. }