Exemplo n.º 1
0
        public Elevator(int id, Floor highestFloor, Floor lowestFloor)
        {
            _upDirectionQueue   = new FloorRequestQueue(ascending);
            _downDirectionQueue = new FloorRequestQueue(descending);
            _stop = true;

            DirectionOfTravel = Direction.Up;
            CurrentFloor      = lowestFloor;
            HighestFloor      = highestFloor;
            Id          = id;
            LowestFloor = lowestFloor;
            _status     = Status.Idle;
        }
Exemplo n.º 2
0
 private IEnumerable <FloorRequest> FloorsBelowCurrent(FloorRequestQueue queue)
 {
     return(queue.Any ? queue.Where(f => f.Floor <= CurrentFloor) : null);
 }