private void CurElevator_Changed(object sender, ElevatorStateChangedEventArgs <ElevatorStates> e)
        {
            switch (e.NewState)
            {
            case ElevatorStates.Starting:
                ChangeStateTo(RiderStates.RidingElevator);
                break;

            case ElevatorStates.Stopping:
                break;

            case ElevatorStates.ChangingFloors:
                break;

            case ElevatorStates.OnFloor:
                this.curElevator = e.Elevator;
                this.curFloor    = e.Elevator.CurrentFloor.ListNode;
                break;

            case ElevatorStates.Inactive:
                ChangeStateTo(RiderStates.OnElevator);
                break;

            case ElevatorStates.Parked:
                break;

            default:
                break;
            }
        }
        public override async void OnStateChanged(StateChangeEventArgs <ElevatorStates> e)
        {
            if (Changed != null)
            {
                var eArgs = new ElevatorStateChangedEventArgs <ElevatorStates>(e, this);
                Changed(this, eArgs);

                switch (e.NewState)
                {
                case ElevatorStates.Starting:
                    Leaving();
                    CheckDirection();
                    await DelayResult(new TimeSpan(0, 0, Globals.STANDARD_TRANSITION_TIMEOUT));

                    ChangeStateTo(ElevatorStates.ChangingFloors);
                    break;

                case ElevatorStates.ChangingFloors:
                    await DelayResult(new TimeSpan(0, 0, Globals.ELEVATOR_TRANSITION_TIMEOUT));

                    ChangeStateTo(ElevatorStates.OnFloor);
                    break;

                case ElevatorStates.OnFloor:
                    await DelayResult(new TimeSpan(0, 0, Globals.STANDARD_TRANSITION_TIMEOUT));

                    SetCurrentFloor();

                    if (ShouldStop())
                    {
                        ChangeStateTo(ElevatorStates.Stopping);
                    }
                    else
                    {
                        ChangeStateTo(ElevatorStates.ChangingFloors);
                    }
                    break;

                case ElevatorStates.Stopping:
                    Arriving();
                    await DelayResult(new TimeSpan(0, 0, Globals.STANDARD_TRANSITION_TIMEOUT));

                    ChangeStateTo(ElevatorStates.Inactive);
                    break;

                case ElevatorStates.Inactive:
                    await DelayResult(new TimeSpan(0, 0, Globals.STANDARD_TRANSITION_TIMEOUT));

                    Arrived();
                    break;

                case ElevatorStates.Parked:
                    break;

                default:
                    break;
                }
            }
        }