Campaign check for valid leave date

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2020-11-08 18:26:06 +03:00
parent 3ae32ebb11
commit eb9223b2c2

View File

@ -52,18 +52,20 @@ public class Campaign {
return timeToLeaveToDest;
}
public void setTimeToLeaveToDest(Date timeToLeaveToDest) {
//TODO: Hesham check if date is before or after Project Date
this.timeToLeaveToDest = timeToLeaveToDest;
public void setTimeToLeaveToDest(Date timeToLeaveToDest) throws OutOfSimulationTimeException {
if(PDate.isValidTime(timeToLeaveToDest))
this.timeToLeaveToDest = timeToLeaveToDest;
else throw new OutOfSimulationTimeException();
}
public Date getTimeToLeaveToHousing() {
return timeToLeaveToHousing;
}
public void setTimeToLeaveToHousing(Date timeToLeaveToHousing) {
//TODO: Hesham check if date is before or after Project Date
this.timeToLeaveToHousing = timeToLeaveToHousing;
public void setTimeToLeaveToHousing(Date timeToLeaveToHousing) throws OutOfSimulationTimeException {
if(PDate.isValidTime(timeToLeaveToHousing))
this.timeToLeaveToHousing = timeToLeaveToHousing;
else throw new OutOfSimulationTimeException();
}
public int getNumberOfBusses() {