src/main/java/tsz/game/model/GameWindow.java
/**
	 * Add new obstacle cars to the game.
	 * @param obstacleCars - list of existing obstacle cars.
	 */
Add new obstacle cars to the game.
@param obstacleCars - list of existing obstacle cars.
Add new obstacle cars to the game . @param obstacleCars - list of existing obstacle cars .
public void addNewCar(List<Car> obstacleCars) {
		int randomForTheAmountOfCars = new Random().nextInt(10);
		int numberOfCars = decidingTheAmountOfCars(randomForTheAmountOfCars);
		List<Integer> availableLanes = new ArrayList<Integer>(Arrays.asList(0,1,2,3,4));
		for(int i = 0; i < numberOfCars; i++) {
            int position = new Random().nextInt(availableLanes.size());
            generatingCars(this.obstacleCars, availableLanes.get(position));
            availableLanes.remove(position);
		}
	}
public void addNewCar ( List < Car > obstacleCars ) { int randomForTheAmountOfCars = new Random ( ) . nextInt ( 10 ) ; int numberOfCars = decidingTheAmountOfCars ( randomForTheAmountOfCars ) ; List < Integer > availableLanes = new ArrayList < Integer > ( Arrays . asList ( 0 , 1 , 2 , 3 , 4 ) ) ; for ( int i = 0 ; i < numberOfCars ; i ++ ) { int position = new Random ( ) . nextInt ( availableLanes . size ( ) ) ; generatingCars ( this . obstacleCars , availableLanes . get ( position ) ) ; availableLanes . remove ( position ) ; } }
Add new obstacle cars to the game.
Add new obstacle cars to the game .