HeroExchange.cpp 860 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. 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 for " +hero->getObjectName() + " by " + exchangePath.toString();
  26. }
  27. uint64_t HeroExchange::getReinforcementArmyStrength(const Nullkiller * ai) const
  28. {
  29. uint64_t armyValue = ai->armyManager->howManyReinforcementsCanGet(hero, exchangePath.heroArmy);
  30. return armyValue;
  31. }
  32. }