예제 #1
0
        // Through this method, we will handling the demand for an elevator from the central panel
        public void assignElevator(int _requestedFloor, String _direction)
        {
            Column column = this.findBestColumn(_requestedFloor);
            //Console.WriteLine("- Selected Column: " + column.name);
            Elevator elevator = column.findElevator(1, _direction);

            //Console.WriteLine("- Selected Elevator: " + elevator.name);
            elevator.floorRequestList.Add(_requestedFloor);
            elevator.move();
        }
예제 #2
0
        //Through this method we will handling the demand for an elevator from your current floor
        public Elevator requestElevator(int _requestedFloor, String _direction)
        {
            //Console.WriteLine("- Current column: " + this.name);
            Elevator elevator = this.findElevator(_requestedFloor, _direction);

            //Console.WriteLine("- Selected Elevator: " + elevator.name);
            elevator.floorRequestList.Add(_requestedFloor);
            elevator.sortFloorList();
            elevator.move();

            return(elevator);
        }