public int FindMostSuitableCheckin(Baggage baggage)
        {
            int chosenIndex = 0;

            foreach (var checkIn in Enumerable.Range(0, checkins.Count))
            {
                if (checkins.ElementAt(checkIn).DestinationGate == baggage.DestinationGate)
                {
                    if (checkins.ElementAt(checkIn).Status == BaggageStatus.Free)
                    {
                        chosenIndex = checkIn;
                        return(chosenIndex);
                    }
                    chosenIndex = checkIn;
                }
            }
            return(chosenIndex);
        }
Exemplo n.º 2
0
 public override void PassBaggage(Baggage Lastbaggage)
 {
     Status  = BaggageStatus.Busy;
     baggage = Lastbaggage;
     ProcessBaggage();
 }
 public override void PassBaggage(Baggage Lastbaggage)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 public override void PassBaggage(Baggage lastbaggage)
 {
     Status          = BaggageStatus.Busy;
     conveyorBelt[0] = lastbaggage;
 }
Exemplo n.º 5
0
 public Conveyor(int capacity, int timerSpeed) : base()
 {
     ConveyorSpeed = timerSpeed;
     timerInterval = timer.Interval;
     conveyorBelt  = new Baggage[capacity];
 }