Пример #1
0
 /// <summary>
 /// Cleans up after a task was successfully executed.
 /// </summary>
 public override void Finish()
 {
     if (Requests.Any())
     {
         throw new InvalidOperationException("An unfinished request cannot be marked as finished!");
     }
     OutputStation.UnregisterInboundPod(ReservedPod);
     OutputStation.UnregisterExtractTask(this);
 }
Пример #2
0
 /// <summary>
 /// Cleans up a cancelled task.
 /// </summary>
 public override void Cancel()
 {
     if (Bot.Pod == null)
     {
         Instance.ResourceManager.ReleasePod(ReservedPod);
     }
     OutputStation.UnregisterInboundPod(ReservedPod);
     OutputStation.UnregisterExtractTask(this);
     for (int i = 0; i < Requests.Count; i++)
     {
         Instance.ResourceManager.ReInsertExtractRequest(Requests[i]);
         ReservedPod.UnregisterItem(Requests[i].Item, Requests[i]);
     }
 }