From: "Enrico Weigelt, metux IT consult" <[email protected]>
---
.../freecol/client/gui/panel/BuildQueuePanel.java | 2 +-
.../client/gui/panel/ConstructionPanel.java | 2 +-
.../gui/panel/colopedia/BuildingDetailPanel.java | 2 +-
.../gui/panel/colopedia/UnitDetailPanel.java | 2 +-
src/net/sf/freecol/common/model/BuildQueue.java | 4 ++--
src/net/sf/freecol/common/model/BuildableType.java | 18 +++---------------
src/net/sf/freecol/common/model/Colony.java | 6 +++---
src/net/sf/freecol/common/model/Role.java | 22 +++++-----------------
src/net/sf/freecol/common/model/Unit.java | 2 +-
src/net/sf/freecol/server/ai/AIColony.java | 6 +++---
src/net/sf/freecol/server/ai/ColonyPlan.java | 2 +-
.../server/ai/mission/PioneeringMission.java | 2 +-
src/net/sf/freecol/server/model/ServerPlayer.java | 2 +-
.../net/sf/freecol/common/model/CombatTest.java | 4 ++--
.../sf/freecol/common/model/SettlementTest.java | 2 +-
.../sf/freecol/common/model/SpecificationTest.java | 22 +++++++++++-----------
.../sf/freecol/server/ai/StandardAIPlayerTest.java | 2 +-
.../server/ai/mission/PioneeringMissionTest.java | 2 +-
.../server/control/InGameControllerTest.java | 8 ++++----
.../sf/freecol/server/model/ServerColonyTest.java | 2 +-
20 files changed, 45 insertions(+), 69 deletions(-)
diff --git a/src/net/sf/freecol/client/gui/panel/BuildQueuePanel.java
b/src/net/sf/freecol/client/gui/panel/BuildQueuePanel.java
index b68c3b05add..63ed8d18f74 100644
--- a/src/net/sf/freecol/client/gui/panel/BuildQueuePanel.java
+++ b/src/net/sf/freecol/client/gui/panel/BuildQueuePanel.java
@@ -494,7 +494,7 @@ public class BuildQueuePanel extends FreeColPanel
implements ItemListener {
}
ImageLibrary lib = getImageLibrary();
- List<AbstractGoods> required = value.getRequiredGoodsList();
+ List<AbstractGoods> required = value.getRequiredGoods();
int size = required.size();
for (int i = 0; i < size; i++) {
AbstractGoods goods = required.get(i);
diff --git a/src/net/sf/freecol/client/gui/panel/ConstructionPanel.java
b/src/net/sf/freecol/client/gui/panel/ConstructionPanel.java
index 3cd59dca2d7..b2b5b031b5f 100644
--- a/src/net/sf/freecol/client/gui/panel/ConstructionPanel.java
+++ b/src/net/sf/freecol/client/gui/panel/ConstructionPanel.java
@@ -186,7 +186,7 @@ public class ConstructionPanel extends MigPanel
label1.setFont(font);
add(label1);
- for (AbstractGoods ag : buildable.getRequiredGoodsList()) {
+ for (AbstractGoods ag : buildable.getRequiredGoods()) {
int amountNeeded = ag.getAmount();
int amountAvailable = colony.getGoodsCount(ag.getType());
int amountProduced =
colony.getAdjustedNetProductionOf(ag.getType());
diff --git
a/src/net/sf/freecol/client/gui/panel/colopedia/BuildingDetailPanel.java
b/src/net/sf/freecol/client/gui/panel/colopedia/BuildingDetailPanel.java
index 1d6ac2ede32..22880927c2c 100644
--- a/src/net/sf/freecol/client/gui/panel/colopedia/BuildingDetailPanel.java
+++ b/src/net/sf/freecol/client/gui/panel/colopedia/BuildingDetailPanel.java
@@ -167,7 +167,7 @@ public class BuildingDetailPanel
if (!buildingType.needsGoodsToBuild()) {
panel.add(Utility.localizedLabel("colopedia.buildings.autoBuilt"),
"span");
} else {
- List<AbstractGoods> required = buildingType.getRequiredGoodsList();
+ List<AbstractGoods> required = buildingType.getRequiredGoods();
AbstractGoods goodsRequired = first(required);
if (required.size() > 1) {
panel.add(getGoodsButton(goodsRequired.getType(),
goodsRequired.getAmount()),
diff --git a/src/net/sf/freecol/client/gui/panel/colopedia/UnitDetailPanel.java
b/src/net/sf/freecol/client/gui/panel/colopedia/UnitDetailPanel.java
index 566a9d1b34a..a48b23ad856 100644
--- a/src/net/sf/freecol/client/gui/panel/colopedia/UnitDetailPanel.java
+++ b/src/net/sf/freecol/client/gui/panel/colopedia/UnitDetailPanel.java
@@ -207,7 +207,7 @@ public class UnitDetailPanel extends
ColopediaGameObjectTypePanel<UnitType> {
if (type.needsGoodsToBuild()) {
panel.add(Utility.localizedLabel("colopedia.unit.goodsRequired"),
"newline 20");
- List<AbstractGoods> required = type.getRequiredGoodsList();
+ List<AbstractGoods> required = type.getRequiredGoods();
AbstractGoods goods = first(required);
if (required.size() > 1) {
panel.add(getGoodsButton(goods.getType(), goods.getAmount()),
diff --git a/src/net/sf/freecol/common/model/BuildQueue.java
b/src/net/sf/freecol/common/model/BuildQueue.java
index b003844671e..4fb6e0248b5 100644
--- a/src/net/sf/freecol/common/model/BuildQueue.java
+++ b/src/net/sf/freecol/common/model/BuildQueue.java
@@ -168,7 +168,7 @@ public class BuildQueue<T extends BuildableType> implements
Consumer {
final boolean overflow = this.colony.getSpecification()
.getBoolean(GameOptions.SAVE_PRODUCTION_OVERFLOW);
List<AbstractGoods> consumption = new ArrayList<>();
- for (AbstractGoods ag : current.getRequiredGoodsList()) {
+ for (AbstractGoods ag : current.getRequiredGoods()) {
AbstractGoods available = AbstractGoods.findByType(input, ag);
if (available != null
&& ag.getAmount() <= available.getAmount()) {
@@ -195,7 +195,7 @@ public class BuildQueue<T extends BuildableType> implements
Consumer {
public List<AbstractGoods> getConsumedGoods() {
T current = getCurrentlyBuilding();
return (current == null) ? Collections.<AbstractGoods>emptyList()
- : current.getRequiredGoodsList();
+ : current.getRequiredGoods();
}
/**
diff --git a/src/net/sf/freecol/common/model/BuildableType.java
b/src/net/sf/freecol/common/model/BuildableType.java
index 2d947d92bab..e263bdcbd55 100644
--- a/src/net/sf/freecol/common/model/BuildableType.java
+++ b/src/net/sf/freecol/common/model/BuildableType.java
@@ -24,7 +24,6 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import java.util.stream.Stream;
import javax.swing.JList;
import javax.xml.stream.XMLStreamException;
@@ -157,7 +156,7 @@ public abstract class BuildableType extends
FreeColSpecObjectType {
*
* @return A deep copy of the list of required goods.
*/
- public List<AbstractGoods> getRequiredGoodsList() {
+ public List<AbstractGoods> getRequiredGoods() {
return (this.requiredGoods == null)
? Collections.<AbstractGoods>emptyList()
: transform(this.requiredGoods, alwaysTrue(),
@@ -165,17 +164,6 @@ public abstract class BuildableType extends
FreeColSpecObjectType {
}
/**
- * Get the goods required to build an instance of this buildable
- * as a stream.
- *
- * @return A stream of the required goods.
- */
- public Stream<AbstractGoods> getRequiredGoods() {
- return (this.requiredGoods == null) ? Stream.<AbstractGoods>empty()
- : getRequiredGoodsList().stream();
- }
-
- /**
* Get the amount required of a given {@code GoodsType} to build
* an instance of this buildable.
*
@@ -183,7 +171,7 @@ public abstract class BuildableType extends
FreeColSpecObjectType {
* @return The amount of goods required.
*/
public int getRequiredAmountOf(GoodsType type) {
- return AbstractGoods.getCount(type, getRequiredGoodsList());
+ return AbstractGoods.getCount(type, getRequiredGoods());
}
/**
@@ -302,7 +290,7 @@ public abstract class BuildableType extends
FreeColSpecObjectType {
}
}
- for (AbstractGoods goods : getRequiredGoodsList()) {
+ for (AbstractGoods goods : getRequiredGoods()) {
xw.writeStartElement(REQUIRED_GOODS_TAG);
xw.writeAttribute(ID_ATTRIBUTE_TAG, goods.getType());
diff --git a/src/net/sf/freecol/common/model/Colony.java
b/src/net/sf/freecol/common/model/Colony.java
index 7cb6ad3559b..cd62183f987 100644
--- a/src/net/sf/freecol/common/model/Colony.java
+++ b/src/net/sf/freecol/common/model/Colony.java
@@ -989,7 +989,7 @@ public class Colony extends Settlement implements Nameable,
TradeLocation {
*/
public int getTurnsToComplete(BuildableType buildable,
AbstractGoods needed) {
- final List<AbstractGoods> required = buildable.getRequiredGoodsList();
+ final List<AbstractGoods> required = buildable.getRequiredGoods();
int turns = 0, satisfied = 0, failing = 0, underway = 0;
ProductionInfo info = productionCache.getProductionInfo(buildQueue);
@@ -1183,7 +1183,7 @@ public class Colony extends Settlement implements
Nameable, TradeLocation {
if (buildable == null) return Collections.<AbstractGoods>emptyList();
List<AbstractGoods> required = new ArrayList<>();
- for (AbstractGoods ag : buildable.getRequiredGoodsList()) {
+ for (AbstractGoods ag : buildable.getRequiredGoods()) {
int amount = ag.getAmount();
GoodsType type = ag.getType();
while (type != null) {
@@ -2813,7 +2813,7 @@ loop: for (WorkLocation wl :
getWorkLocationsForProducing(goodsType)) {
if (buildable != null) {
available -= AbstractGoods.getCount(goods.getType(),
- buildable.getRequiredGoodsList());
+ buildable.getRequiredGoods());
}
if (available < goods.getAmount()) return false;
diff --git a/src/net/sf/freecol/common/model/Role.java
b/src/net/sf/freecol/common/model/Role.java
index 4eb33ed7e7b..fe67d564451 100644
--- a/src/net/sf/freecol/common/model/Role.java
+++ b/src/net/sf/freecol/common/model/Role.java
@@ -24,7 +24,6 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Locale;
-import java.util.stream.Stream;
import javax.xml.stream.XMLStreamException;
@@ -217,8 +216,8 @@ public class Role extends BuildableType {
* @param roleCount The role count.
* @return A list of required goods.
*/
- public List<AbstractGoods> getRequiredGoodsList(int roleCount) {
- List<AbstractGoods> result = getRequiredGoodsList();
+ public List<AbstractGoods> getRequiredGoods(int roleCount) {
+ List<AbstractGoods> result = getRequiredGoods();
if (roleCount > 1 && !result.isEmpty()) {
for (AbstractGoods ag : result) {
ag.setAmount(roleCount * ag.getAmount());
@@ -228,17 +227,6 @@ public class Role extends BuildableType {
}
/**
- * Get the required goods for this role, considering also the role count,
- * as a stream.
- *
- * @param roleCount The role count.
- * @return A stream of required goods.
- */
- public Stream<AbstractGoods> getRequiredGoods(int roleCount) {
- return getRequiredGoodsList(roleCount).stream();
- }
-
- /**
* Get the price of the required goods in a given market.
*
* @param market The {@code Market} to evaluate in.
@@ -356,8 +344,8 @@ public class Role extends BuildableType {
if (from != to && !(from == null && to.isDefaultRole())) {
List<AbstractGoods> fromGoods = (from == null)
? new ArrayList<AbstractGoods>()
- : from.getRequiredGoodsList(fromCount);
- List<AbstractGoods> toGoods = to.getRequiredGoodsList(toCount);
+ : from.getRequiredGoods(fromCount);
+ List<AbstractGoods> toGoods = to.getRequiredGoods(toCount);
for (AbstractGoods ag : toGoods) {
int amount = ag.getAmount()
- AbstractGoods.getCount(ag.getType(), fromGoods);
@@ -386,7 +374,7 @@ public class Role extends BuildableType {
int base = (requiresAbility(Ability.NATIVE)) ? 30
: (requiresAbility(Ability.REF_UNIT)) ? 20
: 10;
- return base - getRequiredGoodsList().size();
+ return base - getRequiredGoods().size();
}
/**
diff --git a/src/net/sf/freecol/common/model/Unit.java
b/src/net/sf/freecol/common/model/Unit.java
index 7aa3266f0fd..577341356f6 100644
--- a/src/net/sf/freecol/common/model/Unit.java
+++ b/src/net/sf/freecol/common/model/Unit.java
@@ -364,7 +364,7 @@ public class Unit extends GoodsLocation
} else {
// Other roles can be characterized by their goods.
List<AbstractGoods> requiredGoods
- = role.getRequiredGoodsList(getRoleCount());
+ = role.getRequiredGoods(getRoleCount());
boolean first = true;
extra = StringTemplate.label("");
for (AbstractGoods ag : requiredGoods) {
diff --git a/src/net/sf/freecol/server/ai/AIColony.java
b/src/net/sf/freecol/server/ai/AIColony.java
index 9bc3eadd3e2..912b3bd2f40 100644
--- a/src/net/sf/freecol/server/ai/AIColony.java
+++ b/src/net/sf/freecol/server/ai/AIColony.java
@@ -1092,7 +1092,7 @@ public class AIColony extends AIObject implements
PropertyChangeListener {
// Add building materials.
if (colony.getCurrentlyBuilding() != null) {
for (AbstractGoods ag : colony.getCurrentlyBuilding()
- .getRequiredGoodsList()) {
+ .getRequiredGoods()) {
if (colony.getAdjustedNetProductionOf(ag.getType()) <= 0) {
required.incrementCount(ag.getType(), ag.getAmount());
}
@@ -1103,7 +1103,7 @@ public class AIColony extends AIObject implements
PropertyChangeListener {
for (TileImprovementPlan plan : tileImprovementPlans) {
Role role = plan.getType().getRequiredRole();
if (role == null) continue;
- for (AbstractGoods ag : role.getRequiredGoodsList()) {
+ for (AbstractGoods ag : role.getRequiredGoods()) {
required.incrementCount(ag.getType(), ag.getAmount());
}
}
@@ -1133,7 +1133,7 @@ public class AIColony extends AIObject implements
PropertyChangeListener {
&& (u.hasDefaultRole()
|| Role.isCompatibleWith(role, u.getRole())));
if (any(colony.getTile().getUnits(), rolePred)) {
- for (AbstractGoods ag : role.getRequiredGoodsList()) {
+ for (AbstractGoods ag : role.getRequiredGoods()) {
required.incrementCount(ag.getType(), ag.getAmount());
}
}
diff --git a/src/net/sf/freecol/server/ai/ColonyPlan.java
b/src/net/sf/freecol/server/ai/ColonyPlan.java
index 7e6b695ec39..91710509f97 100644
--- a/src/net/sf/freecol/server/ai/ColonyPlan.java
+++ b/src/net/sf/freecol/server/ai/ColonyPlan.java
@@ -1216,7 +1216,7 @@ public class ColonyPlan {
// Greedy assignment of other workers to plans.
List<AbstractGoods> buildGoods = new ArrayList<>();
BuildableType build = col.getCurrentlyBuilding();
- if (build != null) buildGoods.addAll(build.getRequiredGoodsList());
+ if (build != null) buildGoods.addAll(build.getRequiredGoods());
List<WorkLocationPlan> wlps;
WorkLocationPlan wlp;
boolean done = false;
diff --git a/src/net/sf/freecol/server/ai/mission/PioneeringMission.java
b/src/net/sf/freecol/server/ai/mission/PioneeringMission.java
index 76cc5c6c8b7..6478fb294b3 100644
--- a/src/net/sf/freecol/server/ai/mission/PioneeringMission.java
+++ b/src/net/sf/freecol/server/ai/mission/PioneeringMission.java
@@ -395,7 +395,7 @@ public class PioneeringMission extends Mission {
return (reason != null)
? reason
: (!hasTools(aiUnit)
- && !colony.canProvideGoods(role.getRequiredGoodsList()))
+ && !colony.canProvideGoods(role.getRequiredGoods()))
? "colony-can-not-provide-equipment"
: null;
}
diff --git a/src/net/sf/freecol/server/model/ServerPlayer.java
b/src/net/sf/freecol/server/model/ServerPlayer.java
index d2e1a23fb19..e49d8b2d602 100644
--- a/src/net/sf/freecol/server/model/ServerPlayer.java
+++ b/src/net/sf/freecol/server/model/ServerPlayer.java
@@ -3438,7 +3438,7 @@ outer: for (Effect effect : effects) {
// Autoequipment is not actually with the unit, it is stored
// in the settlement of the unit. Remove it from there.
- for (AbstractGoods ag : role.getRequiredGoodsList()) {
+ for (AbstractGoods ag : role.getRequiredGoods()) {
settlement.removeGoods(ag);
}
diff --git a/test/src/net/sf/freecol/common/model/CombatTest.java
b/test/src/net/sf/freecol/common/model/CombatTest.java
index 26720c921e3..7c5858ccbea 100644
--- a/test/src/net/sf/freecol/common/model/CombatTest.java
+++ b/test/src/net/sf/freecol/common/model/CombatTest.java
@@ -302,7 +302,7 @@ public class CombatTest extends FreeColTestCase {
// Set up for auto-equip
dutch.addFather(spec().getFoundingFather("model.foundingFather.paulRevere"));
- for (AbstractGoods ag : soldierRole.getRequiredGoodsList()) {
+ for (AbstractGoods ag : soldierRole.getRequiredGoods()) {
colony.addGoods(ag);
}
@@ -339,7 +339,7 @@ public class CombatTest extends FreeColTestCase {
nativeDragoonRole);
Unit attacker = new ServerUnit(game, tile2, dutch, colonistType,
dragoonRole);
- for (AbstractGoods ag : nativeDragoonRole.getRequiredGoodsList()) {
+ for (AbstractGoods ag : nativeDragoonRole.getRequiredGoods()) {
is.addGoods(ag);
}
diff --git a/test/src/net/sf/freecol/common/model/SettlementTest.java
b/test/src/net/sf/freecol/common/model/SettlementTest.java
index 5f28306d1ae..89722a9e30a 100644
--- a/test/src/net/sf/freecol/common/model/SettlementTest.java
+++ b/test/src/net/sf/freecol/common/model/SettlementTest.java
@@ -164,7 +164,7 @@ public class SettlementTest extends FreeColTestCase {
// Colony now has enough equipment
colony.addGoods(musketsType, 10);
- assertTrue(colony.canProvideGoods(soldierRole.getRequiredGoodsList()));
+ assertTrue(colony.canProvideGoods(soldierRole.getRequiredGoods()));
assertEquals(soldierRole,
colony.canImproveUnitMilitaryRole(colonist));
diff --git a/test/src/net/sf/freecol/common/model/SpecificationTest.java
b/test/src/net/sf/freecol/common/model/SpecificationTest.java
index 3a525179896..c780916dad5 100644
--- a/test/src/net/sf/freecol/common/model/SpecificationTest.java
+++ b/test/src/net/sf/freecol/common/model/SpecificationTest.java
@@ -292,57 +292,57 @@ public final class SpecificationTest extends
FreeColTestCase {
Role role;
role = spec.getRole("model.role.default");
assertNotNull(role);
- checkGoods(role.getId(), role.getRequiredGoodsList());
+ checkGoods(role.getId(), role.getRequiredGoods());
role = spec.getRole("model.role.scout");
assertNotNull(role);
- checkGoods(role.getId(), role.getRequiredGoodsList(),
+ checkGoods(role.getId(), role.getRequiredGoods(),
new AbstractGoods(horsesType, 50));
role = spec.getRole("model.role.soldier");
assertNotNull(role);
- checkGoods(role.getId(), role.getRequiredGoodsList(),
+ checkGoods(role.getId(), role.getRequiredGoods(),
new AbstractGoods(musketsType, 50));
role = spec.getRole("model.role.dragoon");
assertNotNull(role);
- checkGoods(role.getId(), role.getRequiredGoodsList(),
+ checkGoods(role.getId(), role.getRequiredGoods(),
new AbstractGoods(horsesType, 50),
new AbstractGoods(musketsType, 50));
role = spec.getRole("model.role.pioneer");
assertNotNull(role);
- checkGoods(role.getId(), role.getRequiredGoodsList(),
+ checkGoods(role.getId(), role.getRequiredGoods(),
new AbstractGoods(toolsType, 20));
role = spec.getRole("model.role.missionary");
assertNotNull(role);
- checkGoods(role.getId(), role.getRequiredGoodsList());
+ checkGoods(role.getId(), role.getRequiredGoods());
role = spec.getRole("model.role.infantry");
assertNotNull(role);
- checkGoods(role.getId(), role.getRequiredGoodsList(),
+ checkGoods(role.getId(), role.getRequiredGoods(),
new AbstractGoods(musketsType, 50));
role = spec.getRole("model.role.cavalry");
assertNotNull(role);
- checkGoods(role.getId(), role.getRequiredGoodsList(),
+ checkGoods(role.getId(), role.getRequiredGoods(),
new AbstractGoods(horsesType, 50),
new AbstractGoods(musketsType, 50));
role = spec.getRole("model.role.mountedBrave");
assertNotNull(role);
- checkGoods(role.getId(), role.getRequiredGoodsList(),
+ checkGoods(role.getId(), role.getRequiredGoods(),
new AbstractGoods(horsesType, 25));
role = spec.getRole("model.role.armedBrave");
assertNotNull(role);
- checkGoods(role.getId(), role.getRequiredGoodsList(),
+ checkGoods(role.getId(), role.getRequiredGoods(),
new AbstractGoods(musketsType, 25));
role = spec.getRole("model.role.nativeDragoon");
assertNotNull(role);
- checkGoods(role.getId(), role.getRequiredGoodsList(),
+ checkGoods(role.getId(), role.getRequiredGoods(),
new AbstractGoods(horsesType, 25),
new AbstractGoods(musketsType, 25));
}
diff --git a/test/src/net/sf/freecol/server/ai/StandardAIPlayerTest.java
b/test/src/net/sf/freecol/server/ai/StandardAIPlayerTest.java
index 0036eb60b5c..ccbe48052ab 100644
--- a/test/src/net/sf/freecol/server/ai/StandardAIPlayerTest.java
+++ b/test/src/net/sf/freecol/server/ai/StandardAIPlayerTest.java
@@ -52,7 +52,7 @@ public class StandardAIPlayerTest extends FreeColTestCase {
}
private void setupNativeDragoons() {
- for (AbstractGoods ag : nativeDragoonRole.getRequiredGoodsList()) {
+ for (AbstractGoods ag : nativeDragoonRole.getRequiredGoods()) {
if (ag.getType() == horsesType) {
horsesReqPerUnit = ag.getAmount();
} else if (ag.getType() == musketsType) {
diff --git
a/test/src/net/sf/freecol/server/ai/mission/PioneeringMissionTest.java
b/test/src/net/sf/freecol/server/ai/mission/PioneeringMissionTest.java
index 9dfdde11024..2cf42cc3529 100644
--- a/test/src/net/sf/freecol/server/ai/mission/PioneeringMissionTest.java
+++ b/test/src/net/sf/freecol/server/ai/mission/PioneeringMissionTest.java
@@ -101,7 +101,7 @@ public class PioneeringMissionTest extends FreeColTestCase {
// Add some tools to the colony, mission should become viable.
colony.addGoods(toolsGoodsType, 100);
assertTrue("Colony can provide tools",
- colony.canProvideGoods(pioneerRole.getRequiredGoodsList()));
+ colony.canProvideGoods(pioneerRole.getRequiredGoods()));
assertEquals("Colony found", colony,
PioneeringMission.findTarget(aiUnit, 10, false));
assertNull("Pioneer has no mission",
diff --git a/test/src/net/sf/freecol/server/control/InGameControllerTest.java
b/test/src/net/sf/freecol/server/control/InGameControllerTest.java
index 4804ec76ac6..0fdd03d45ad 100644
--- a/test/src/net/sf/freecol/server/control/InGameControllerTest.java
+++ b/test/src/net/sf/freecol/server/control/InGameControllerTest.java
@@ -961,7 +961,7 @@ public class InGameControllerTest extends FreeColTestCase {
dutch.addFather(spec()
.getFoundingFather("model.foundingFather.paulRevere"));
java.util.Map<GoodsType,Integer> goodsAdded = new HashMap<>();
- for (AbstractGoods goods : soldierRole.getRequiredGoodsList()) {
+ for (AbstractGoods goods : soldierRole.getRequiredGoods()) {
colony.addGoods(goods);
goodsAdded.put(goods.getType(), goods.getAmount());
}
@@ -978,7 +978,7 @@ public class InGameControllerTest extends FreeColTestCase {
colonist.isDisposed());
assertFalse("Colonist should not be captured",
colonist.getOwner() == attacker.getOwner());
- for (AbstractGoods goods : soldierRole.getRequiredGoodsList()) {
+ for (AbstractGoods goods : soldierRole.getRequiredGoods()) {
boolean goodsLost = colony.getGoodsCount(goods.getType())
< goodsAdded.get(goods.getType());
assertTrue("Colony should have lost " + goods.getType().toString(),
@@ -1736,7 +1736,7 @@ public class InGameControllerTest extends FreeColTestCase
{
= new FreeColTestCase.IndianSettlementBuilder(game);
IndianSettlement camp = builder.build();
ServerPlayer indian = (ServerPlayer)camp.getOwner();
- List<AbstractGoods> required =
nativeDragoonRole.getRequiredGoodsList();
+ List<AbstractGoods> required = nativeDragoonRole.getRequiredGoods();
int horsesReqPerUnit = AbstractGoods.getCount(horsesType, required);
int musketsReqPerUnit = AbstractGoods.getCount(musketsType, required);
@@ -1787,7 +1787,7 @@ public class InGameControllerTest extends FreeColTestCase
{
= new FreeColTestCase.IndianSettlementBuilder(game);
IndianSettlement camp = builder.build();
- List<AbstractGoods> required = mountedBraveRole.getRequiredGoodsList();
+ List<AbstractGoods> required = mountedBraveRole.getRequiredGoods();
int horsesReq = AbstractGoods.getCount(horsesType, required);
int musketsReq = AbstractGoods.getCount(musketsType, required);
diff --git a/test/src/net/sf/freecol/server/model/ServerColonyTest.java
b/test/src/net/sf/freecol/server/model/ServerColonyTest.java
index 699e6f89aff..2e89683576f 100644
--- a/test/src/net/sf/freecol/server/model/ServerColonyTest.java
+++ b/test/src/net/sf/freecol/server/model/ServerColonyTest.java
@@ -259,7 +259,7 @@ public class ServerColonyTest extends FreeColTestCase {
Unit unit = new ServerUnit(game, colony.getTile(), colony.getOwner(),
colonistType);
unit.setLocation(colony);
- for (AbstractGoods ag : lumberMillType.getRequiredGoodsList()) {
+ for (AbstractGoods ag : lumberMillType.getRequiredGoods()) {
GoodsType type = ag.getType();
int amount = ag.getAmount() + 1;
colony.addGoods(type, amount);
--
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