package communication.messages;

/**
 * A class to represent the elevator sensor reporting the position of an elevator
 * at a certain floor ,to be used for sending the new position to the scheduler.
 */
public class ElevatorSensorMessage implements Message {
	private static final long serialVersionUID = 9061173841232815343L;
	private final int currentFloor;
	private final int elevatorId;

	/**
	 * Construct a floor sensor message with a specified elevator and floor ID
	 *
	 * @param currentFloor the floor that the elevator is at
	 * @param elevatorId   the elevator whose position this is
	 */
	public ElevatorSensorMessage(int currentFloor, int elevatorId) {
		this.currentFloor = currentFloor;
		this.elevatorId = elevatorId;
	}

	public int getCurrentFloor() {
		return currentFloor;
	}

	public int getElevatorId() {
		return elevatorId;
	}

	@Override
	public String toString() {
		return "FloorSensorMessage [currentFloor=" + currentFloor + ", elevatorId=" + elevatorId + "]";
	}
}
