Fix error in Camp.addVehicle()

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2020-11-09 12:30:18 +03:00
parent 11252e7996
commit af5548734d

View File

@ -56,11 +56,10 @@ public class Street {
return true; return true;
} }
public void addVehicle( Vehicle vehicle ) { public void addVehicle(Vehicle vehicle) {
if(capcity()>0) { if(capcity() > 0) {
for(int i=0;i<getVehicles().size();i++) { //adds incoming vehicle in last.
addVehicle.set(i, getVehicles().get(i)); vehicles.add(vehicle);
}
} }
//TODO Ammar i hope that //TODO Ammar i hope that
} }