2020-10-21 04:42:45 +02:00
|
|
|
import java.util.Date;
|
2020-11-06 22:07:50 +01:00
|
|
|
|
2020-10-20 01:33:57 +02:00
|
|
|
public class Campaign {
|
2020-10-09 21:22:37 +02:00
|
|
|
|
2020-11-06 17:21:46 +01:00
|
|
|
private String UID;
|
|
|
|
//private int housingNumber;
|
2020-10-09 21:22:37 +02:00
|
|
|
private String name;
|
2020-11-06 17:21:46 +01:00
|
|
|
private District hotelDistrict;
|
2020-10-09 21:22:37 +02:00
|
|
|
|
2020-10-21 04:42:45 +02:00
|
|
|
private Route housingToDestRoute;
|
|
|
|
private Route destToHousingRoute;
|
|
|
|
|
|
|
|
private Vehicle[] vehicles;
|
|
|
|
|
|
|
|
//Will be of type PDate after extention
|
|
|
|
private Date timeToLeaveToDest;
|
|
|
|
private Date timeToLeaveToHousing;
|
|
|
|
|
2020-11-06 17:21:46 +01:00
|
|
|
private static int numeberOfCampains;
|
|
|
|
|
2020-11-06 20:53:08 +01:00
|
|
|
public Campaign(District hotelDistrict, int numberofBusses) {
|
2020-11-06 17:21:46 +01:00
|
|
|
this.hotelDistrict = hotelDistrict;
|
2020-11-06 20:53:08 +01:00
|
|
|
generateBusses(numberofBusses);
|
|
|
|
generateUID();
|
2020-10-21 04:42:45 +02:00
|
|
|
}
|
2020-10-09 21:22:37 +02:00
|
|
|
|
2020-11-06 20:53:08 +01:00
|
|
|
public Campaign(District hotelDistrict, Vehicle[] vehicles) {
|
|
|
|
this.hotelDistrict = hotelDistrict;
|
|
|
|
setVehicles(vehicles);
|
|
|
|
generateUID();
|
2020-10-21 04:42:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public Route getHousingToDestRoute() {
|
|
|
|
return housingToDestRoute;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setHousingToDestRoute(Route housingToDestRoute) {
|
|
|
|
this.housingToDestRoute = housingToDestRoute;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Route getDestToHousingRoute() {
|
|
|
|
return destToHousingRoute;
|
|
|
|
}
|
2020-10-09 21:22:37 +02:00
|
|
|
|
2020-10-21 04:42:45 +02:00
|
|
|
public void setDestToHousingRoute(Route destToHousingRoute) {
|
|
|
|
this.destToHousingRoute = destToHousingRoute;
|
2020-10-09 21:22:37 +02:00
|
|
|
}
|
|
|
|
|
2020-11-06 20:53:08 +01:00
|
|
|
public District getHotelDistrict(){ return this.hotelDistrict; }
|
|
|
|
|
|
|
|
public Date getTimeToLeaveToDest() {
|
|
|
|
return timeToLeaveToDest;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setTimeToLeaveToDest(Date timeToLeaveToDest) {
|
2020-11-08 14:34:10 +01:00
|
|
|
//TODO: Hesham check if date is before or after Project Date
|
2020-11-06 20:53:08 +01:00
|
|
|
this.timeToLeaveToDest = timeToLeaveToDest;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Date getTimeToLeaveToHousing() {
|
|
|
|
return timeToLeaveToHousing;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setTimeToLeaveToHousing(Date timeToLeaveToHousing) {
|
2020-11-08 14:34:10 +01:00
|
|
|
//TODO: Hesham check if date is before or after Project Date
|
2020-11-06 20:53:08 +01:00
|
|
|
this.timeToLeaveToHousing = timeToLeaveToHousing;
|
|
|
|
}
|
|
|
|
|
2020-10-21 04:42:45 +02:00
|
|
|
public int getNumberOfBusses() {
|
|
|
|
int busses = 0;
|
|
|
|
for (Vehicle vehicle : vehicles){
|
|
|
|
if (vehicle instanceof Bus) busses++;
|
|
|
|
}
|
|
|
|
return busses;
|
2020-10-09 21:22:37 +02:00
|
|
|
}
|
2020-11-06 17:21:46 +01:00
|
|
|
|
2020-11-06 20:49:33 +01:00
|
|
|
public Vehicle[] getVehicles() {
|
|
|
|
return this.vehicles;
|
|
|
|
}
|
|
|
|
|
2020-11-06 17:21:46 +01:00
|
|
|
public void setVehicles(Vehicle[] vehicles){
|
2020-11-08 14:34:10 +01:00
|
|
|
/*TODO: Osama check if vehicles is not null then set vehicles. */
|
2020-11-06 17:21:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void generateBusses(int number){
|
2020-11-08 14:34:10 +01:00
|
|
|
/*TODO: Asaad generate "number" of busses and set them to vehicles array. */
|
2020-11-06 20:53:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
private void generateUID() {
|
|
|
|
numeberOfCampains++;
|
2020-11-06 21:28:58 +01:00
|
|
|
this.UID = String.format("%04d", numeberOfCampains);
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getUID(){
|
|
|
|
return this.UID;
|
2020-11-06 17:21:46 +01:00
|
|
|
}
|
2020-10-09 21:22:37 +02:00
|
|
|
}
|