/// <summary> /// Executes behavior with given context /// </summary> /// <param name="context">The context.</param> /// <returns></returns> public override BehaviorReturnCode Behave(IBehaviorContext context) { UnitBehaviorContext unitContext = context as UnitBehaviorContext; if (unitContext == null) { returnCode = BehaviorReturnCode.Failure; return(returnCode); } ResourcesExtractor unit = unitContext.Unit as ResourcesExtractor; if (unit == null) { returnCode = BehaviorReturnCode.Failure; return(returnCode); } ExtractTask task = new ExtractTask(unit); task.Execute(); returnCode = BehaviorReturnCode.Success; return(returnCode); }
/// <summary> /// Unregister an extract task with this station. /// </summary> /// <param name="task">The task that was done or cancelled for this station.</param> internal void UnregisterExtractTask(ExtractTask task) { _activeExtractTasks.Remove(task); }
/// <summary> /// Register an extract task with this station. /// </summary> /// <param name="task">The task that shall be done at this station.</param> internal void RegisterExtractTask(ExtractTask task) { _activeExtractTasks.Add(task); }