package main; import java.util.Iterator; import java.util.LinkedList; public class Level { public LinkedList lstUnits; public Level() { this.lstUnits = new LinkedList(); } public Level(final Level copy) { this.lstUnits = new LinkedList(); final Iterator iter = copy.lstUnits.iterator(); while (iter.hasNext()) { this.lstUnits.add(iter.next()); } } public void addUnit(final Ship u) { this.lstUnits.add(u); u.loc = new Location(Math.random() * 800.0, -100.0); u.targetLoc = new Location(u.loc.getX(), u.loc.getY() + 250); } }