mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
NKAI: fix build
This commit is contained in:
parent
30d9daf62c
commit
ff654c2148
@ -28,7 +28,7 @@ namespace AIPathfinding
|
|||||||
bool allowBypassObjects)
|
bool allowBypassObjects)
|
||||||
{
|
{
|
||||||
std::vector<std::shared_ptr<IPathfindingRule>> rules = {
|
std::vector<std::shared_ptr<IPathfindingRule>> rules = {
|
||||||
std::make_shared<AILayerTransitionRule>(cb, ai, nodeStorage, allowBypassObjects),
|
std::make_shared<AILayerTransitionRule>(cb, ai, nodeStorage),
|
||||||
std::make_shared<DestinationActionRule>(),
|
std::make_shared<DestinationActionRule>(),
|
||||||
std::make_shared<AIMovementToDestinationRule>(nodeStorage, allowBypassObjects),
|
std::make_shared<AIMovementToDestinationRule>(nodeStorage, allowBypassObjects),
|
||||||
std::make_shared<MovementCostRule>(),
|
std::make_shared<MovementCostRule>(),
|
||||||
|
@ -99,6 +99,7 @@ class ISpecialActionFactory
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual std::shared_ptr<SpecialAction> create(const Nullkiller * ai) = 0;
|
virtual std::shared_ptr<SpecialAction> create(const Nullkiller * ai) = 0;
|
||||||
|
virtual ~ISpecialActionFactory() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,7 @@ public:
|
|||||||
|
|
||||||
ConnectionCostInfo currentCost = getConnectionsCost(paths);
|
ConnectionCostInfo currentCost = getConnectionsCost(paths);
|
||||||
|
|
||||||
if(currentCost.connectionsCount <= 1 || currentCost.connectionsCount == 2 && currentCost.totalCost < 3.0f)
|
if(currentCost.connectionsCount <= 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
float neighborCost = getNeighborConnectionsCost(pos, paths);
|
float neighborCost = getNeighborConnectionsCost(pos, paths);
|
||||||
@ -179,7 +179,6 @@ private:
|
|||||||
{
|
{
|
||||||
auto from = path.targetHero->visitablePos();
|
auto from = path.targetHero->visitablePos();
|
||||||
auto fromObj = actorObjectMap[path.targetHero];
|
auto fromObj = actorObjectMap[path.targetHero];
|
||||||
auto fromTile = cb->getTile(from);
|
|
||||||
|
|
||||||
auto danger = ai->pathfinder->getStorage()->evaluateDanger(pos, path.targetHero, true);
|
auto danger = ai->pathfinder->getStorage()->evaluateDanger(pos, path.targetHero, true);
|
||||||
auto updated = target->tryAddConnection(
|
auto updated = target->tryAddConnection(
|
||||||
|
@ -20,9 +20,8 @@ namespace AIPathfinding
|
|||||||
AILayerTransitionRule::AILayerTransitionRule(
|
AILayerTransitionRule::AILayerTransitionRule(
|
||||||
CPlayerSpecificInfoCallback * cb,
|
CPlayerSpecificInfoCallback * cb,
|
||||||
Nullkiller * ai,
|
Nullkiller * ai,
|
||||||
std::shared_ptr<AINodeStorage> nodeStorage,
|
std::shared_ptr<AINodeStorage> nodeStorage)
|
||||||
bool allowEmbark)
|
:cb(cb), ai(ai), nodeStorage(nodeStorage)
|
||||||
:cb(cb), ai(ai), nodeStorage(nodeStorage), allowEmbark(allowEmbark)
|
|
||||||
{
|
{
|
||||||
setup();
|
setup();
|
||||||
}
|
}
|
||||||
|
@ -32,14 +32,12 @@ namespace AIPathfinding
|
|||||||
std::map<const CGHeroInstance *, std::shared_ptr<const SummonBoatAction>> summonableVirtualBoats;
|
std::map<const CGHeroInstance *, std::shared_ptr<const SummonBoatAction>> summonableVirtualBoats;
|
||||||
std::map<const CGHeroInstance *, std::shared_ptr<const WaterWalkingAction>> waterWalkingActions;
|
std::map<const CGHeroInstance *, std::shared_ptr<const WaterWalkingAction>> waterWalkingActions;
|
||||||
std::map<const CGHeroInstance *, std::shared_ptr<const AirWalkingAction>> airWalkingActions;
|
std::map<const CGHeroInstance *, std::shared_ptr<const AirWalkingAction>> airWalkingActions;
|
||||||
bool allowEmbark;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AILayerTransitionRule(
|
AILayerTransitionRule(
|
||||||
CPlayerSpecificInfoCallback * cb,
|
CPlayerSpecificInfoCallback * cb,
|
||||||
Nullkiller * ai,
|
Nullkiller * ai,
|
||||||
std::shared_ptr<AINodeStorage> nodeStorage,
|
std::shared_ptr<AINodeStorage> nodeStorage);
|
||||||
bool allowEmbark);
|
|
||||||
|
|
||||||
virtual void process(
|
virtual void process(
|
||||||
const PathNodeInfo & source,
|
const PathNodeInfo & source,
|
||||||
|
Loading…
Reference in New Issue
Block a user