2020-10-21 04:42:45 +02:00
|
|
|
import java.util.Date;
|
|
|
|
|
2020-10-20 01:33:57 +02:00
|
|
|
public class Campaign {
|
2020-10-09 21:22:37 +02:00
|
|
|
|
|
|
|
private int UID;
|
|
|
|
private int numberOfPeople;
|
2020-10-21 04:42:45 +02:00
|
|
|
private int housingNumber;
|
2020-10-09 21:22:37 +02:00
|
|
|
private String name;
|
|
|
|
private boolean local;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
public Campaign(int numberOfPeople, String name, Route housingToDestRoute, Route destToHousingRoute) {
|
|
|
|
setNumberOfPeople(numberOfPeople);
|
|
|
|
this.name = name;
|
|
|
|
this.housingToDestRoute = housingToDestRoute;
|
|
|
|
this.destToHousingRoute = destToHousingRoute;
|
|
|
|
}
|
2020-10-09 21:22:37 +02:00
|
|
|
|
|
|
|
public Campaign(int numberOfPeople){
|
2020-10-21 04:42:45 +02:00
|
|
|
setNumberOfPeople(numberOfPeople);
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getNumberOfPeople() {
|
|
|
|
return numberOfPeople;
|
2020-10-09 21:22:37 +02:00
|
|
|
}
|
|
|
|
|
2020-10-21 04:42:45 +02:00
|
|
|
public void setNumberOfPeople(int numberOfPeople) {
|
|
|
|
if (numberOfPeople > 0) this.numberOfPeople = numberOfPeople;
|
|
|
|
else throw new IllegalArgumentException("Negative number of people in camp");
|
|
|
|
}
|
|
|
|
|
|
|
|
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-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
|
|
|
}
|
|
|
|
}
|