From: "Enrico Weigelt, metux IT consult" <[email protected]>
---
src/net/sf/freecol/common/model/Tile.java | 27 +++++++++++++++++----------
1 file changed, 17 insertions(+), 10 deletions(-)
diff --git a/src/net/sf/freecol/common/model/Tile.java
b/src/net/sf/freecol/common/model/Tile.java
index d524ed49f88..897fcc70acb 100644
--- a/src/net/sf/freecol/common/model/Tile.java
+++ b/src/net/sf/freecol/common/model/Tile.java
@@ -1408,8 +1408,10 @@ public final class Tile extends UnitLocation implements
Named, Ownable {
* @return The most defensible adjacent land {@code Tile}.
*/
public Tile getBestDisembarkTile(Player player) {
- return find(getSafestSurroundingLandTiles(player),
- Tile::isHighSeasConnected);
+ for (Tile t : getSafestSurroundingLandTiles(player))
+ if (t.isHighSeasConnected())
+ return t;
+ return null;
}
/**
@@ -1809,10 +1811,12 @@ public final class Tile extends UnitLocation implements
Named, Ownable {
* Update production after a change to this tile.
*/
private void updateColonyTiles() {
- WorkLocation wl = find(flatten(getGame().getAllColonies(null),
- Colony::getAvailableWorkLocations),
- matchKey(this, WorkLocation::getWorkTile));
- if (wl != null) wl.updateProductionType();
+ for (Colony c : getGame().getAllColonies(null))
+ for (WorkLocation wl : c.getAvailableWorkLocations())
+ if (wl.getWorkTile() == this) {
+ wl.updateProductionType();
+ break;
+ }
}
/**
@@ -2094,10 +2098,13 @@ public final class Tile extends UnitLocation implements
Named, Ownable {
if (getOwningSettlement() != null) {
owner = getOwningSettlement().getOwner();
}
- return (owner != null && unit != null && unit.getOwner() != owner
- && unit.getOwner().atWarWith(owner))
- ? find(getUnits(), Unit::isOffensiveUnit)
- : null;
+
+ if (owner != null && unit != null && unit.getOwner() != owner
+ && unit.getOwner().atWarWith(owner))
+ for (Unit u : getUnits())
+ if (u.isOffensiveUnit()) return u;
+
+ return null;
}
/**
--
2.11.0.rc0.7.gbe5a750
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Freecol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freecol-developers