/// <summary> /// add a task to the tasklist /// </summary> /// <param name="task">the task to be added</param> public void ChainTask(Units.ITask task) { task.Prepare(this); this.tasklist.AddLast(task); }
/// <summary> /// Executes a task at instance and removes all other tasks /// </summary> /// <param name="task">the task to be executed</param> public void ExecuteTask(Units.ITask task) { task.Prepare(this); foreach (Units.ITask ttask in this.tasklist) ttask.Cancel(); this.tasklist.Clear(); this.ChainTask(task); }
/// <summary> /// starts a task and move the others back /// </summary> /// <param name="task">the task to add</param> public void AddProrizedTask(Units.ITask task) { task.Prepare(this); if(this.tasklist.First != null) this.tasklist.First.Value.Pause(); this.tasklist.AddFirst(task); }