示例#1
0
        private static void Reset(AutomatedPicker picker)
        {
            if (picker.Carrying != null)
            {
                picker.Drop();
            }

            picker.GoToLocation("Recharging Station");
        }
示例#2
0
        private static void Reset(AutomatedPicker picker)
        {
            if (picker.Carrying != null)
            {
                picker.Drop();
            }

            picker.GoToLocation("Recharging Station");
        }
示例#3
0
        public static void ReleasePicker(AutomatedPicker picker)
        {
            Reset(picker);

            lock (_available)
            {
                _available.Add(picker);
                _inUse.Remove(picker);
            }
        }
示例#4
0
        public static void ReleasePicker(AutomatedPicker picker)
        {
            Reset(picker);

            lock (_available)
            {
                _available.Add(picker);
                _inUse.Remove(picker);
            }
        }
示例#5
0
        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);
            }
        }