Elevator Interview Problem OOP Can someone please critique my Elevator problem - I wanted to use OOP principles and coding standards.
Also, does logic make sense?


Once elevator starts going up it needs to finish all requests for above floors, same for down.


So I imagine that if the elevator is moving up and the request is floor below it will need to finish all up/above requests etc.



internal class Program
{
    private const string _quit = "q";

    private static void Main(string[] args)
    {
        var manager = new Manager();
        var input = string.Empty;

        while (input != _quit) {
            Console.Write("Enter floor: ");
            input = Console.ReadLine();
            int floor;
            if (int.TryParse(input, out floor))
                manager.ButtonPressed(floor);
            else if (input == _quit)
                Console.WriteLine("GoodBye!");
            else
                Console.WriteLine("You have pressed an incorrect floor, Please try again");
        }
    }
}

internal enum Status
{
    GoingUp,
    GoingDown,
    Stopped
}

internal class Elevator
{
    public int TopFloor;

    public Elevator(int topFloor)
    {
        TopFloor = topFloor;
    }

    public int CurrentFloor { get; set; } = 1;
    public Status Status { get; set; } = Status.Stopped;

    public void MoveUp(int floor)
    {
        Status = Status.GoingUp;
        Console.WriteLine("Going up to: {0}", floor);
        CurrentFloor = floor;
        OpenDoor();
        CloseDoor();
    }

    public void MoveDown(int floor)
    {
        Status = Status.GoingDown;
        Console.WriteLine("Going down to: {0}", floor);
        CurrentFloor = floor;
        OpenDoor();
        CloseDoor();
    }

    private void OpenDoor()
    {
        Console.WriteLine("Door opening");
    }

    private void CloseDoor()
    {
        Console.WriteLine("Door closing, at floor: {0}", this.CurrentFloor);
    }
}

internal class Request
{
    public Request(int floor)
    {
        Floor = floor;
    }

    public int Floor { get; set; }
}

internal class Manager
{
    private readonly Queue&lt;Request&gt; _downRequests = new Queue&lt;Request&gt;();
    private readonly Elevator _elevator = new Elevator(10);
    private readonly Queue&lt;Request&gt; _upRequests = new Queue&lt;Request&gt;();

    public void ButtonPressed(int floor)
    {
        if (floor &gt; _elevator.TopFloor) {
            Console.WriteLine("Only have {0} floors", _elevator.TopFloor);
            return;
        }

        if (floor &gt; _elevator.CurrentFloor) 
            _upRequests.Enqueue(new Request(floor));
        else
            _downRequests.Enqueue(new Request(floor));

        Move(floor);
    }

    private void Move(int floor)
    {
        switch (_elevator.Status) {
            case Status.GoingDown:
                while(_downRequests.Count &gt; 0)
                    _elevator.MoveDown(_downRequests.Dequeue().Floor);

                _elevator.Status = Status.Stopped;
                break;

            case Status.GoingUp:
                while(_upRequests.Count &gt; 0)
                    _elevator.MoveUp(_upRequests.Dequeue().Floor);

                _elevator.Status = Status.Stopped;
                break;

            case Status.Stopped:
                if (floor &gt; _elevator.CurrentFloor)
                    _elevator.Status = Status.GoingUp;
                else if (floor &lt;= _elevator.CurrentFloor) {
                    _elevator.Status = Status.GoingDown;
                }
                Move(floor);

                break;
            default:
                break;
        }
    }
}


Revised code based on feedback: Elevator Interview Problem OOP - Revised
I see a few things I would do differently.  For one, I would not use a Queue.  At best, it's providing you an order in which floor buttons were pressed.  While the buttons may be pressed in any order, an elevator moves in sequential order be it up or down.

I would keep a simple List&lt;bool&gt; where true denotes a floor to stop at.  Once you stop at a floor, no need to Dequeue.  Instead just set the flag to false.  By keeping it simple, you won't have to jump through hoops if you are going up but someone presses buttons for 10, 5, 2, 9, 7.