1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-20 20:23:03 +02:00
vcmi/AI/Nullkiller/Pathfinding/AIPathfinder.h

45 lines
992 B
C
Raw Normal View History

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"
class Nullkiller;
2021-05-15 18:22:44 +02:00
struct PathfinderSettings
{
bool useHeroChain;
uint8_t scoutTurnDistanceLimit;
2021-05-16 14:01:34 +02:00
uint8_t mainTurnDistanceLimit;
PathfinderSettings()
:useHeroChain(false),
2021-05-16 14:01:34 +02:00
scoutTurnDistanceLimit(255),
mainTurnDistanceLimit(255)
{ }
};
2021-05-15 18:22:44 +02:00
class AIPathfinder
{
private:
std::shared_ptr<AINodeStorage> storage;
2021-05-15 18:22:44 +02:00
CPlayerSpecificInfoCallback * cb;
Nullkiller * ai;
2021-05-15 18:22:44 +02:00
public:
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;
void updatePaths(std::map<const CGHeroInstance *, HeroRole> heroes, PathfinderSettings pathfinderSettings);
2021-05-15 18:22:44 +02:00
void init();
};