/// <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); }
/// <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]); } }