Example #1
0
 public void RequestFloor(Elevator elevator, int requestedFloor)
 {
     Console.WriteLine($"Request Floor: {requestedFloor}, with elevator: {elevator.id}, and current floor: {elevator.currentFloor}");
     elevator.AddQueue(requestedFloor);
     elevator.CloseDoor();
     elevator.MoveElevator();
 }
Example #2
0
    public Elevator RequestElevator(int requestedFloor, string direction)
    {
        Console.WriteLine($"Request Elevator: {requestedFloor} and direction: {direction}");
        Elevator elevator = FindBestElevator(requestedFloor, direction);

        elevator.AddQueue(requestedFloor);
        elevator.MoveElevator();
        return(elevator);
    }