1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

NKAI: namespace

This commit is contained in:
Andrii Danylchenko
2022-09-26 21:01:07 +03:00
parent 5c44c8f4da
commit eeea01d778
121 changed files with 713 additions and 471 deletions

View File

@@ -12,11 +12,15 @@
#include "../../AIGateway.h"
#include "../../Goals/AdventureSpellCast.h"
#include "../../Goals/CaptureObject.h"
#include "../../Goals/Invalid.h"
#include "../../Goals/BuildBoat.h"
#include "../../../../lib/mapping/CMap.h"
#include "../../../../lib/mapObjects/MapObjects.h"
#include "BoatActions.h"
namespace NKAI
{
extern boost::thread_specific_ptr<CCallback> cb;
extern boost::thread_specific_ptr<AIGateway> ai;
@@ -34,7 +38,7 @@ namespace AIPathfinding
return Goals::sptr(Goals::CaptureObject(shipyard->o));
}
return sptr(Goals::Invalid());
return Goals::sptr(Goals::Invalid());
}
bool BuildBoatAction::canAct(const AIPathNode * source) const
@@ -43,7 +47,7 @@ namespace AIPathfinding
if(cb->getPlayerRelations(hero->tempOwner, shipyard->o->tempOwner) == PlayerRelations::ENEMIES)
{
#if AI_TRACE_LEVEL > 1
#if NKAI_TRACE_LEVEL > 1
logAi->trace("Can not build a boat. Shipyard is enemy.");
#endif
return false;
@@ -55,7 +59,7 @@ namespace AIPathfinding
if(!cb->getResourceAmount().canAfford(source->actor->armyCost + boatCost))
{
#if AI_TRACE_LEVEL > 1
#if NKAI_TRACE_LEVEL > 1
logAi->trace("Can not build a boat. Not enough resources.");
#endif
@@ -128,4 +132,6 @@ namespace AIPathfinding
return hero->getSpellCost(summonBoat.toSpell());
}
}
}
}