Merge pull request #2 from AsaadDadoush/master

Edit
This commit is contained in:
HeshamTB 2020-11-08 16:40:37 +03:00 committed by GitHub
commit 4110fc97ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 64 additions and 6 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
out/
/bin/

View File

@ -13,7 +13,6 @@ public class Accident {
}
private void setDate(Date date){
//TODO: maybe change to Calendar type
this.date = date;
}

View File

@ -53,7 +53,7 @@ public class Campaign {
}
public void setTimeToLeaveToDest(Date timeToLeaveToDest) {
//TODO: check if date is before or after Project Date
//TODO: Hesham check if date is before or after Project Date
this.timeToLeaveToDest = timeToLeaveToDest;
}
@ -62,7 +62,7 @@ public class Campaign {
}
public void setTimeToLeaveToHousing(Date timeToLeaveToHousing) {
//TODO: check if date is before or after Project Date
//TODO: Hesham check if date is before or after Project Date
this.timeToLeaveToHousing = timeToLeaveToHousing;
}
@ -79,11 +79,11 @@ public class Campaign {
}
public void setVehicles(Vehicle[] vehicles){
/*TODO: check if vehicles is not null then set vehicles. */
/*TODO: Osama check if vehicles is not null then set vehicles. */
}
public void generateBusses(int number){
/*TODO: generate "number" of busses and set them to vehicles array. */
/*TODO: Asaad generate "number" of busses and set them to vehicles array. */
}
private void generateUID() {

9
src/MakkahCity.java Normal file
View File

@ -0,0 +1,9 @@
public class MakkahCity {
public static void main(String[] args) {
}
}

15
src/SUV.java Normal file
View File

@ -0,0 +1,15 @@
public class SUV extends CivilVehicle {
private final int TIME_TO_FIX = 15; //in minutes
public SUV(double vehicleSize){
super(vehicleSize);
}
public int getTimeToFix(){
return TIME_TO_FIX;
}
}

View File

@ -5,6 +5,7 @@ public class Street {
private double length;
private int numberOfLanes;
private ArrayList<Vehicle> vehicles;
public Street(double length, int numberOfLanes) {
setLength(length);
@ -37,4 +38,22 @@ public class Street {
public ArrayList<Vehicle> getVehicles() {
return vehicles;
}
public double capcity() {
double totalLength = length * numberOfLanes;
//TODO Ammar return (total length - (length of cars + padding))
return 0;
}
public boolean canTakeVehicles( Vehicle vehicle ) {
if ( vehicle.getVehicleSize() > capcity() )
return false;
else
return true;
}
public void addVehicle( Vehicle vehicle ) {
//TODO Ammar
}
}

View File

@ -9,7 +9,7 @@ public class TrafficPoliceCar extends Vehicle implements CanBeGovtCar, CanFixAcc
*/
public TrafficPoliceCar(double vehicleSize){
super(vehicleSize);
//TODO: Set random govtID
//TODO: Osamah Set random govtID
}
/**

15
src/Truck.java Normal file
View File

@ -0,0 +1,15 @@
public class Truck extends CivilVehicle {
private final int TIME_TO_FIX = 20; //in minutes
public Truck(double vehicleSize){
super(vehicleSize);
}
public int getTimeToFix(){
return TIME_TO_FIX;
}
}