mirror of https://github.com/FreeCol/freecol.git
Allows the map to be iterable over tiles.
This commit is contained in:
parent
dfbd8b8671
commit
146009a942
|
@ -74,7 +74,7 @@ import net.sf.freecol.common.util.LogBuilder;
|
|||
* In theory, a {@link Game} might contain several Map instances
|
||||
* connected by the HighSeas.
|
||||
*/
|
||||
public class Map extends FreeColGameObject implements Location {
|
||||
public class Map extends FreeColGameObject implements Location, Iterable<Tile> {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Map.class.getName());
|
||||
|
||||
|
@ -834,6 +834,11 @@ public class Map extends FreeColGameObject implements Location {
|
|||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Tile> iterator() {
|
||||
return Collections.unmodifiableList(tileList).iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a list of all the tiles that match a predicate.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue