Beispiel #1
0
 private void RequestNextTask()
 {
     CMDebug.TextPopup("RequestNextTask", worker.GetPosition());
     CM_GameHandler.Task task = taskSystem.RequestNextTask();
     if (task == null)
     {
         // No tasks available, wait before asking again
         state = State.WaitingForNextTask;
     }
     else
     {
         // There is a task available, execute it depending on type
         state = State.ExecutingTask;
         if (task is CM_GameHandler.Task.MoveToPosition)
         {
             ExecuteTask_MoveToPosition(task as CM_GameHandler.Task.MoveToPosition);
             return;
         }
         if (task is CM_GameHandler.Task.Victory)
         {
             ExecuteTask_Victory(task as CM_GameHandler.Task.Victory);
             return;
         }
         if (task is CM_GameHandler.Task.ShellFloorCleanUp)
         {
             ExecuteTask_ShellFloorCleanUp(task as CM_GameHandler.Task.ShellFloorCleanUp);
             return;
         }
         if (task is CM_GameHandler.Task.TakeWeaponToWeaponSlot)
         {
             ExecuteTask_TakeWeaponToWeaponSlot(task as CM_GameHandler.Task.TakeWeaponToWeaponSlot);
             return;
         }
         // Task type unknown, error!
         Debug.LogError("Task type unknown!");
     }
 }
Beispiel #2
0
 private void RequestNextTask()
 {
     CMDebug.TextPopup("RequestNextTask", worker.GetPosition());
     CM_GameHandler.TransporterTask task = taskSystem.RequestNextTask();
     if (task == null)
     {
         // No tasks available, wait before asking again
         state = State.WaitingForNextTask;
     }
     else
     {
         // There is a task available, execute it depending on type
         state = State.ExecutingTask;
         if (task is CM_GameHandler.TransporterTask.TakeWeaponFromSlotToPosition)
         {
             ExecuteTask_TakeWeaponFromSlotToPosition(task as CM_GameHandler.TransporterTask.TakeWeaponFromSlotToPosition);
             return;
         }
         // Task type unknown, error!
         Debug.LogError("Task type unknown!");
     }
 }