From: "Enrico Weigelt, metux IT consult" <[email protected]>
---
.../freecol/client/gui/panel/report/ReportMilitaryPanel.java | 2 +-
src/net/sf/freecol/common/model/IndianSettlement.java | 2 +-
src/net/sf/freecol/common/model/Monarch.java | 2 +-
src/net/sf/freecol/common/model/Settlement.java | 2 +-
src/net/sf/freecol/common/model/Specification.java | 11 +----------
src/net/sf/freecol/common/model/Unit.java | 2 +-
test/src/net/sf/freecol/common/model/RoleTest.java | 2 +-
7 files changed, 7 insertions(+), 16 deletions(-)
diff --git
a/src/net/sf/freecol/client/gui/panel/report/ReportMilitaryPanel.java
b/src/net/sf/freecol/client/gui/panel/report/ReportMilitaryPanel.java
index 58225a8e084..c3fcbe45fa3 100644
--- a/src/net/sf/freecol/client/gui/panel/report/ReportMilitaryPanel.java
+++ b/src/net/sf/freecol/client/gui/panel/report/ReportMilitaryPanel.java
@@ -123,7 +123,7 @@ public final class ReportMilitaryPanel extends
ReportUnitPanel {
// Report unit types that are inherently reportable, and units
// with military roles.
- final List<Role> militaryRoles = spec.getMilitaryRolesList();
+ final List<Role> militaryRoles = spec.getMilitaryRoles();
for (UnitType ut : spec.getUnitTypeList()) {
if (reportable(ut)) {
tryUnitRole(ut, Specification.DEFAULT_ROLE_ID);
diff --git a/src/net/sf/freecol/common/model/IndianSettlement.java
b/src/net/sf/freecol/common/model/IndianSettlement.java
index e3b8e3e6122..72b71b8a2f5 100644
--- a/src/net/sf/freecol/common/model/IndianSettlement.java
+++ b/src/net/sf/freecol/common/model/IndianSettlement.java
@@ -822,7 +822,7 @@ public class IndianSettlement extends Settlement implements
TradeLocation {
final Specification spec = getSpecification();
final UnitType unitType = getFirstUnit().getType();
final List<Role> militaryRoles = Role.getAvailableRoles(getOwner(),
- unitType, spec.getMilitaryRolesList());
+ unitType, spec.getMilitaryRoles());
if (type.getMilitary()) { // Retain enough goods to fully arm
return sum(getOwnedUnits(),
diff --git a/src/net/sf/freecol/common/model/Monarch.java
b/src/net/sf/freecol/common/model/Monarch.java
index 02e9135fd0c..8ea6afe28a7 100644
--- a/src/net/sf/freecol/common/model/Monarch.java
+++ b/src/net/sf/freecol/common/model/Monarch.java
@@ -311,7 +311,7 @@ public final class Monarch extends FreeColGameObject
implements Named {
mercenaryTypes.add(unitType);
}
}
- for (Role r : spec.getMilitaryRolesList()) {
+ for (Role r : spec.getMilitaryRoles()) {
boolean ok = r.isAvailableTo(player, first(landTypes));
boolean armed = r.hasAbility(Ability.ARMED);
boolean mounted = r.hasAbility(Ability.MOUNTED);
diff --git a/src/net/sf/freecol/common/model/Settlement.java
b/src/net/sf/freecol/common/model/Settlement.java
index deb26d6f2d8..7b43c2eafca 100644
--- a/src/net/sf/freecol/common/model/Settlement.java
+++ b/src/net/sf/freecol/common/model/Settlement.java
@@ -427,7 +427,7 @@ public abstract class Settlement extends GoodsLocation
final Role role = unit.getRole();
// Get the military roles that are superior to the current role
- List<Role> military = spec.getMilitaryRolesList();
+ List<Role> military = spec.getMilitaryRoles();
int index = military.indexOf(role);
if (index >= 0) military = military.subList(0, index);
diff --git a/src/net/sf/freecol/common/model/Specification.java
b/src/net/sf/freecol/common/model/Specification.java
index 4154bc6b0c8..3e7b5364044 100644
--- a/src/net/sf/freecol/common/model/Specification.java
+++ b/src/net/sf/freecol/common/model/Specification.java
@@ -1660,7 +1660,7 @@ public final class Specification {
*
* @return An unmodifiable list of military {@code Role}s.
*/
- public List<Role> getMilitaryRolesList() {
+ public List<Role> getMilitaryRoles() {
if (this.militaryRoles == null) {
this.militaryRoles = Collections.<Role>unmodifiableList(
transform(this.roles, Role::isOffensive, Function.identity(),
@@ -1670,15 +1670,6 @@ public final class Specification {
}
/**
- * Get the available military roles as a stream.
- *
- * @return A stream of military {@code Role}s.
- */
- public Stream<Role> getMilitaryRoles() {
- return getMilitaryRolesList().stream();
- }
-
- /**
* Gets the roles suitable for a REF unit.
*
* @param naval If true, choose roles for naval units, if not, land units.
diff --git a/src/net/sf/freecol/common/model/Unit.java
b/src/net/sf/freecol/common/model/Unit.java
index e4e545a8559..b4f875550ec 100644
--- a/src/net/sf/freecol/common/model/Unit.java
+++ b/src/net/sf/freecol/common/model/Unit.java
@@ -1782,7 +1782,7 @@ public class Unit extends GoodsLocation
if (!hasAbility(Ability.CAPTURE_EQUIPMENT)) return null;
final Specification spec = getSpecification();
final Role oldRole = getRole();
- return find(getAvailableRoles(spec.getMilitaryRolesList()),
+ return find(getAvailableRoles(spec.getMilitaryRoles()),
r -> any(r.getRoleChanges(), rc ->
rc.getFrom(spec) == oldRole && rc.getCapture(spec) == role));
}
diff --git a/test/src/net/sf/freecol/common/model/RoleTest.java
b/test/src/net/sf/freecol/common/model/RoleTest.java
index 983bd21ab79..76fc899f942 100644
--- a/test/src/net/sf/freecol/common/model/RoleTest.java
+++ b/test/src/net/sf/freecol/common/model/RoleTest.java
@@ -130,7 +130,7 @@ public class RoleTest extends FreeColTestCase {
public void testMilitaryRoles() {
final Game game = getStandardGame();
- final List<Role> military = spec().getMilitaryRolesList();
+ final List<Role> military = spec().getMilitaryRoles();
List<Role> expectedRoles = new ArrayList<>();
expectedRoles.add(dragoon);
--
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