mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Enum for PriorityTiers
In order to not confuse PriorityTiers, especially after adding new ones, now using an enum to identify them.
This commit is contained in:
@@ -180,7 +180,7 @@ Goals::TTaskVec Nullkiller::buildPlan(TGoalVec & tasks, int priorityTier) const
|
||||
for(size_t i = r.begin(); i != r.end(); i++)
|
||||
{
|
||||
auto task = tasks[i];
|
||||
if (task->asTask()->priority <= 0 || priorityTier != 0)
|
||||
if (task->asTask()->priority <= 0 || priorityTier != PriorityEvaluator::PriorityTier::BUILDINGS)
|
||||
task->asTask()->priority = evaluator->evaluate(task, priorityTier);
|
||||
}
|
||||
});
|
||||
@@ -385,7 +385,7 @@ void Nullkiller::makeTurn()
|
||||
|
||||
if(bestTask->priority > 0)
|
||||
{
|
||||
logAi->info("Pass %d: Performing task %s with prio: %d", bestTask->toString(), bestTask->priority);
|
||||
logAi->info("Pass %d: Performing task %s with prio: %d", i, bestTask->toString(), bestTask->priority);
|
||||
if(!executeTask(bestTask))
|
||||
return;
|
||||
|
||||
@@ -408,7 +408,7 @@ void Nullkiller::makeTurn()
|
||||
|
||||
TTaskVec selectedTasks;
|
||||
int prioOfTask = 0;
|
||||
for (int prio = 1; prio <= 6; ++prio)
|
||||
for (int prio = PriorityEvaluator::PriorityTier::INSTAKILL; prio <= PriorityEvaluator::PriorityTier::DEFEND; ++prio)
|
||||
{
|
||||
prioOfTask = prio;
|
||||
selectedTasks = buildPlan(bestTasks, prio);
|
||||
|
||||
Reference in New Issue
Block a user