1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

refactoring RecruitHeroBehavior + test sample; renamed more Nullkiller variables consistently

This commit is contained in:
Mircea TheHonestCTO
2025-08-24 09:12:34 +02:00
parent 54ad621357
commit 58543f23cf
44 changed files with 335 additions and 261 deletions

View File

@@ -27,7 +27,7 @@ namespace NK2AI
using namespace Goals;
DeepDecomposer::DeepDecomposer(const Nullkiller * aiNk)
:ai(aiNk), depth(0)
:aiNk(aiNk), depth(0)
{
}
@@ -139,7 +139,7 @@ Goals::TSubgoal DeepDecomposer::aggregateGoals(int startDepth, TSubgoal last)
Goals::TSubgoal DeepDecomposer::unwrapComposition(Goals::TSubgoal goal)
{
return goal->goalType == Goals::COMPOSITION ? goal->decompose(ai).back() : goal;
return goal->goalType == Goals::COMPOSITION ? goal->decompose(aiNk).back() : goal;
}
bool isEquivalentGoals(TSubgoal goal1, TSubgoal goal2)
@@ -159,7 +159,7 @@ bool isEquivalentGoals(TSubgoal goal1, TSubgoal goal2)
bool DeepDecomposer::isCompositionLoop(TSubgoal goal)
{
auto goalsToTest = goal->goalType == Goals::COMPOSITION ? goal->decompose(ai) : TGoalVec{goal};
auto goalsToTest = goal->goalType == Goals::COMPOSITION ? goal->decompose(aiNk) : TGoalVec{goal};
for(auto goalToTest : goalsToTest)
{
@@ -209,7 +209,7 @@ TGoalVec DeepDecomposer::decomposeCached(TSubgoal goal, bool & fromCache)
fromCache = false;
return goal->decompose(ai);
return goal->decompose(aiNk);
}
void DeepDecomposer::addToCache(TSubgoal goal)