Fixed minor glitch where I would calculate cheapest task too often.

This commit is contained in:
2017-11-26 18:20:23 -08:00
parent e44ec0ee5b
commit edd769b151
1 changed files with 14 additions and 4 deletions

View File

@ -12,15 +12,15 @@ namespace StarAI.ExecutionCore
public static List<CustomTask> taskList = new List<CustomTask>();
public static Task executioner = new Task(new Action(runTaskList));
public static List<CustomTask> removalList = new List<CustomTask>();
public static void runTaskList()
{
//myTask t = new myTask(StarAI.PathFindingCore.CropLogic.CropLogic.harvestSingleCrop);
List<CustomTask> removalList = new List<CustomTask>();
bool assignNewTask = true;
foreach(var task in taskList)
while(ranAllTasks()==false)
{
@ -59,8 +59,18 @@ namespace StarAI.ExecutionCore
taskList.Clear();
removalList.Clear();
}
public static bool ranAllTasks()
{
foreach(CustomTask task in taskList)
{
if (removalList.Contains(task)) continue;
else return false;
}
return true;
}
public static void printAllTaskMetaData()