Package net.sf.freecol.common.networking
Class RearrangeColonyMessage.Arrangement
- java.lang.Object
-
- net.sf.freecol.common.networking.RearrangeColonyMessage.Arrangement
-
- Enclosing class:
- RearrangeColonyMessage
public static class RearrangeColonyMessage.Arrangement extends java.lang.Object
Container for the unit change information.
-
-
Constructor Summary
Constructors Constructor Description Arrangement()
Arrangement(Game game, java.lang.String unitId, java.lang.String locId, java.lang.String workId, java.lang.String roleId, java.lang.String roleCount)
Arrangement(Unit unit, Location loc, GoodsType work, Role role, int roleCount)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<RearrangeColonyMessage.Arrangement>
getArrangements(Colony colony, java.util.List<Unit> workers, Colony scratch)
Create new arrangements for a given list of worker units on the basis of a scratch colony configuration.void
init(Game game, java.lang.String unitId, java.lang.String locId, java.lang.String workId, java.lang.String roleId, java.lang.String roleCount)
static java.lang.String
locKey(int i)
int
roleComparison(RearrangeColonyMessage.Arrangement other)
Role comparison for use in rearrangeColony.static java.lang.String
roleCountKey(int i)
static java.lang.String
roleKey(int i)
java.lang.String
toString()
static java.lang.String
unitKey(int i)
static java.lang.String
workKey(int i)
-
-
-
Constructor Detail
-
Arrangement
public Arrangement()
-
Arrangement
public Arrangement(Game game, java.lang.String unitId, java.lang.String locId, java.lang.String workId, java.lang.String roleId, java.lang.String roleCount)
-
-
Method Detail
-
init
public final void init(Game game, java.lang.String unitId, java.lang.String locId, java.lang.String workId, java.lang.String roleId, java.lang.String roleCount)
-
unitKey
public static java.lang.String unitKey(int i)
-
locKey
public static java.lang.String locKey(int i)
-
workKey
public static java.lang.String workKey(int i)
-
roleKey
public static java.lang.String roleKey(int i)
-
roleCountKey
public static java.lang.String roleCountKey(int i)
-
getArrangements
public static java.util.List<RearrangeColonyMessage.Arrangement> getArrangements(Colony colony, java.util.List<Unit> workers, Colony scratch)
Create new arrangements for a given list of worker units on the basis of a scratch colony configuration.- Parameters:
colony
- The originalColony
.workers
- A list of workerUnit
s to arrange.scratch
- The scratchColony
.- Returns:
- A list of
Arrangement
s.
-
roleComparison
public int roleComparison(RearrangeColonyMessage.Arrangement other)
Role comparison for use in rearrangeColony.- Parameters:
other
- TheArrangement
to compare to.- Returns:
- A comparison value.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-