2021-05-16 13:56:35 +02:00
|
|
|
/*
|
|
|
|
* HeroExchange.cpp, part of VCMI engine
|
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#include "StdInc.h"
|
|
|
|
#include "HeroExchange.h"
|
2021-05-16 14:39:38 +02:00
|
|
|
#include "../AIGateway.h"
|
2021-05-16 13:56:35 +02:00
|
|
|
#include "../Engine/Nullkiller.h"
|
|
|
|
#include "../AIUtility.h"
|
2021-05-16 13:56:42 +02:00
|
|
|
#include "../Analyzers/ArmyManager.h"
|
2021-05-16 13:56:35 +02:00
|
|
|
|
2022-09-26 20:01:07 +02:00
|
|
|
namespace NKAI
|
|
|
|
{
|
|
|
|
|
2021-05-16 13:56:35 +02:00
|
|
|
using namespace Goals;
|
|
|
|
|
|
|
|
bool HeroExchange::operator==(const HeroExchange & other) const
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string HeroExchange::toString() const
|
|
|
|
{
|
2024-04-14 14:23:44 +02:00
|
|
|
return "Hero exchange for " +hero->getObjectName() + " by " + exchangePath.toString();
|
2021-05-16 13:56:35 +02:00
|
|
|
}
|
|
|
|
|
2024-03-31 17:39:00 +02:00
|
|
|
uint64_t HeroExchange::getReinforcementArmyStrength(const Nullkiller * ai) const
|
2021-05-16 13:56:35 +02:00
|
|
|
{
|
2024-04-14 14:23:44 +02:00
|
|
|
uint64_t armyValue = ai->armyManager->howManyReinforcementsCanGet(hero, exchangePath.heroArmy);
|
2021-05-16 13:56:35 +02:00
|
|
|
|
|
|
|
return armyValue;
|
2022-09-26 20:01:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|