public boolean pressFloorButton(int floor) {
	    Lib.assertTrue(inElevator && floor >= 0 && floor < numFloors);

	    if (elevators[elevator].doorsOpen &&
		elevators[elevator].floor == floor)
		return false;
	    
	    manager.postEvent(ElevatorEvent.eventFloorButtonPressed,
			      floor, elevator, true);

	    if (gui != null)
		gui.pressFloorButton(floor, elevator);

	    return true;
	}