Example #1
0
 private int FindFreeCourier(CourierCollection collection)
 {
     for (int i = 0; i < collection.Length; i++)
     {
         if (collection[i].IsFree)
         {
             //collection[i].IsFree = false;
             return(i);
         }
     }
     return(-1);
 }
Example #2
0
            public override void MakeDelivery(CourierCollection collection)
            {
                int index = FindFreeCourier(collection);

                if (index == -1)
                {
                    Console.WriteLine("Все курьеры заняты, попробуйте сделать заказ позже");
                }
                else
                {
                    collection[index].IsFree = false;
                }
            }
Example #3
0
        static void Main(string[] args)
        {
            var array = new Courier[]
            {
                new Courier {
                    IsFree = true
                },
                new Courier {
                    IsFree = true
                },
                new Courier {
                    IsFree = true
                },
            };

            CourierCollection collection = new CourierCollection(array);

            var order = new Order <ShopDelivery>();

            order.Delivery.MakeDelivery();
            //
            //
            //
        }
Example #4
0
 public override void TakeItem(int index, CourierCollection collection)
 {
     collection[index].IsFree = true;
 }
Example #5
0
 public abstract void TakeItem(int index, CourierCollection collection = null);
Example #6
0
 public abstract void MakeDelivery(CourierCollection collection        = null);
Example #7
0
 public override void TakeItem(int index, CourierCollection collection = null)
 {
     PickPoint.ItemCycleOnPickPoint[index] = 0;
 }
Example #8
0
 public override void MakeDelivery(CourierCollection collection = null)
 {
 }
Example #9
0
 public override void MakeDelivery(CourierCollection collection = null)
 {
     FindFreePlace();
 }