/** * Checks to see if a param of the arry list is full * * @return true or false */ public boolean isFull() { for (Level indiv_level : levels) { if (!indiv_level.isFull()) { return false; } } return true; }
/** * Adds car to array list if num of spots isnt full * * @param incomingCar * @return the level the car was added to */ public int addCar(Car incomingCar) { int counter = 1; for (Level indiv_level : levels) { if (!indiv_level.isFull()) { indiv_level.addCar(incomingCar); break; } counter++; } return counter; }