Merge branch 'master' of https://git.lamaisondescouillons.fr/ccolin/projet-gl
This commit is contained in:
commit
864419c22e
@ -1 +0,0 @@
|
|||||||
,p16003795,L-662722FORM-16.salsa.univ-amu.fr,14.10.2019 13:17,file:///amuhome/p16003795/.config/libreoffice/4;
|
|
@ -3,8 +3,7 @@ package Requests;
|
|||||||
public class CallFromElevatorRequest extends Request {
|
public class CallFromElevatorRequest extends Request {
|
||||||
|
|
||||||
public CallFromElevatorRequest(int wantedFloor) {
|
public CallFromElevatorRequest(int wantedFloor) {
|
||||||
super();
|
super(RequestType.CALLFROMELEVATOR);
|
||||||
this.wantedFloor = wantedFloor;
|
this.wantedFloor = wantedFloor;
|
||||||
this.type = RequestType.CALLFROMELEVATOR;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,9 @@ public class CallFromFloorRequest extends Request {
|
|||||||
|
|
||||||
|
|
||||||
public CallFromFloorRequest(int sourceFloor, Direction direction) {
|
public CallFromFloorRequest(int sourceFloor, Direction direction) {
|
||||||
super();
|
super(RequestType.CALLFROMFLOOR);
|
||||||
this.sourceFloor = sourceFloor;
|
this.sourceFloor = sourceFloor;
|
||||||
this.direction = direction;
|
this.direction = direction;
|
||||||
this.type = RequestType.CALLFROMFLOOR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
9
src/Requests/CancelEmergencyStopRequest.java
Normal file
9
src/Requests/CancelEmergencyStopRequest.java
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package Requests;
|
||||||
|
|
||||||
|
public class CancelEmergencyStopRequest extends Request{
|
||||||
|
|
||||||
|
public CancelEmergencyStopRequest() {
|
||||||
|
super(RequestType.CANCELEMERGENCYSTOP);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -3,7 +3,6 @@ package Requests;
|
|||||||
public class EmergencyStopRequest extends Request {
|
public class EmergencyStopRequest extends Request {
|
||||||
|
|
||||||
public EmergencyStopRequest() {
|
public EmergencyStopRequest() {
|
||||||
super();
|
super(RequestType.EMERGENCYSTOP);
|
||||||
this.type = RequestType.EMERGENCYSTOP;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
src/Requests/ReachedFloorSignal.java
Normal file
10
src/Requests/ReachedFloorSignal.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package Requests;
|
||||||
|
|
||||||
|
public class ReachedFloorSignal extends Request{
|
||||||
|
public ReachedFloorSignal(int reachedFLoor) {
|
||||||
|
super(RequestType.REACHEDFLOORSIGNAL);
|
||||||
|
this.reachedFloor = reachedFLoor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -8,8 +8,11 @@ public abstract class Request {
|
|||||||
protected int wantedFloor;
|
protected int wantedFloor;
|
||||||
protected int sourceFloor;
|
protected int sourceFloor;
|
||||||
protected Direction direction;
|
protected Direction direction;
|
||||||
|
protected int reachedFloor;
|
||||||
|
|
||||||
public Request() {
|
public Request(RequestType type) {
|
||||||
|
this.type = type;
|
||||||
|
this.reachedFloor = -1;
|
||||||
this.wantedFloor = -1;
|
this.wantedFloor = -1;
|
||||||
this.sourceFloor = -1;
|
this.sourceFloor = -1;
|
||||||
this.direction = Direction.NONE;
|
this.direction = Direction.NONE;
|
||||||
@ -17,7 +20,7 @@ public abstract class Request {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return the direction of the request, unconcerned extending classes return NONE
|
* @return the direction of the request, unconcerned extending classes return NONE.
|
||||||
*/
|
*/
|
||||||
public Direction getDirection() {
|
public Direction getDirection() {
|
||||||
return direction;
|
return direction;
|
||||||
@ -25,7 +28,7 @@ public abstract class Request {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return the wished floor, unconcerned extending classes return -1
|
* @return the wished floor, unconcerned extending classes return -1.
|
||||||
*/
|
*/
|
||||||
public int getWantedFloor() {
|
public int getWantedFloor() {
|
||||||
return wantedFloor;
|
return wantedFloor;
|
||||||
@ -33,14 +36,25 @@ public abstract class Request {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return the floor it was called from, unconcerned extending classes return -1
|
* @return the floor it was called from, unconcerned extending classes return -1.
|
||||||
*/
|
*/
|
||||||
public int getIncomingCallFloor() {
|
public int getIncomingCallFloor() {
|
||||||
return sourceFloor;
|
return sourceFloor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return the RequestType of the request.
|
||||||
|
*/
|
||||||
public RequestType getType() {
|
public RequestType getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return the floor the elevator just reached, unconcerned extending classes return -1.
|
||||||
|
*/
|
||||||
|
public int getReachedFloor() {
|
||||||
|
return reachedFloor;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package Requests;
|
package Requests;
|
||||||
|
|
||||||
public enum RequestType {
|
public enum RequestType {
|
||||||
CALLFROMFLOOR, CALLFROMELEVATOR, EMERGENCYSTOP, CANCELEMERGENCYSTOP
|
CALLFROMFLOOR, CALLFROMELEVATOR, EMERGENCYSTOP, CANCELEMERGENCYSTOP, REACHEDFLOORSIGNAL
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user