private static void Reset(AutomatedPicker picker) { if (picker.Carrying != null) { picker.Drop(); } picker.GoToLocation("Recharging Station"); }
public static void ReleasePicker(AutomatedPicker picker) { Reset(picker); lock (_available) { _available.Add(picker); _inUse.Remove(picker); } }
public static AutomatedPicker GetPicker() { lock (_available) { if (_available.Count == 0) { throw new InvalidOperationException("No pickers are available"); } AutomatedPicker picker = _available[0]; _inUse.Add(picker); _available.RemoveAt(0); return(picker); } }