HeroExchange.cpp 920 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 "../AIGateway.h"
  13. #include "../Engine/Nullkiller.h"
  14. #include "../AIUtility.h"
  15. #include "../Analyzers/ArmyManager.h"
  16. namespace NKAI
  17. {
  18. extern boost::thread_specific_ptr<CCallback> cb;
  19. extern boost::thread_specific_ptr<AIGateway> ai;
  20. using namespace Goals;
  21. bool HeroExchange::operator==(const HeroExchange & other) const
  22. {
  23. return false;
  24. }
  25. std::string HeroExchange::toString() const
  26. {
  27. return "Hero exchange " + exchangePath.toString();
  28. }
  29. uint64_t HeroExchange::getReinforcementArmyStrength() const
  30. {
  31. uint64_t armyValue = ai->nullkiller->armyManager->howManyReinforcementsCanGet(hero.get(), exchangePath.heroArmy);
  32. return armyValue;
  33. }
  34. }