2021-05-15 18:22:44 +02:00
|
|
|
/*
|
|
|
|
* AIPathfinder.h, 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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "AINodeStorage.h"
|
|
|
|
#include "../AIUtility.h"
|
2020-05-04 17:58:43 +02:00
|
|
|
|
|
|
|
class Nullkiller;
|
2021-05-15 18:22:44 +02:00
|
|
|
|
2021-05-16 13:56:21 +02:00
|
|
|
struct PathfinderSettings
|
|
|
|
{
|
|
|
|
bool useHeroChain;
|
|
|
|
uint8_t scoutTurnDistanceLimit;
|
2021-05-16 14:01:34 +02:00
|
|
|
uint8_t mainTurnDistanceLimit;
|
2021-05-16 13:56:21 +02:00
|
|
|
|
|
|
|
PathfinderSettings()
|
|
|
|
:useHeroChain(false),
|
2021-05-16 14:01:34 +02:00
|
|
|
scoutTurnDistanceLimit(255),
|
|
|
|
mainTurnDistanceLimit(255)
|
2021-05-16 13:56:21 +02:00
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
2021-05-15 18:22:44 +02:00
|
|
|
class AIPathfinder
|
|
|
|
{
|
|
|
|
private:
|
2021-05-16 13:49:39 +02:00
|
|
|
std::shared_ptr<AINodeStorage> storage;
|
2021-05-15 18:22:44 +02:00
|
|
|
CPlayerSpecificInfoCallback * cb;
|
2020-05-04 17:58:43 +02:00
|
|
|
Nullkiller * ai;
|
2021-05-15 18:22:44 +02:00
|
|
|
|
|
|
|
public:
|
2020-05-04 17:58:43 +02:00
|
|
|
AIPathfinder(CPlayerSpecificInfoCallback * cb, Nullkiller * ai);
|
2021-05-15 20:56:31 +02:00
|
|
|
std::vector<AIPath> getPathInfo(const int3 & tile) const;
|
2021-05-15 18:22:44 +02:00
|
|
|
bool isTileAccessible(const HeroPtr & hero, const int3 & tile) const;
|
2021-05-16 13:56:21 +02:00
|
|
|
void updatePaths(std::map<const CGHeroInstance *, HeroRole> heroes, PathfinderSettings pathfinderSettings);
|
2021-05-15 18:22:44 +02:00
|
|
|
void init();
|
|
|
|
};
|