示例#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;
        }
示例#2
0
 private IEnumerable <FloorRequest> FloorsBelowCurrent(FloorRequestQueue queue)
 {
     return(queue.Any ? queue.Where(f => f.Floor <= CurrentFloor) : null);
 }