Package net.sf.freecol.common.model
Class UnitWas
- java.lang.Object
-
- net.sf.freecol.common.model.UnitWas
-
-
Field Summary
Fields Modifier and Type Field Description private Colonycolonyprivate Locationlocprivate static java.util.logging.Loggerloggerprivate intmovesLeftprivate Roleroleprivate introleCountprivate UnitTypetypeprivate Unitunitprivate java.util.List<Unit>unitsprivate GoodsTypeworkprivate intworkAmount
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.Stringchange(FreeColGameObject fcgo)intcompareTo(UnitWas uw)booleanequals(java.lang.Object o)booleanfireChanges()Fire any property changes resulting from actions of a unit.private intgetAmount(Location location, GoodsType goodsType)LocationgetLocation()UnitgetUnit()GoodsTypegetWorkType()inthashCode()java.lang.StringtoString()
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
unit
private final Unit unit
-
type
private final UnitType type
-
role
private final Role role
-
roleCount
private final int roleCount
-
loc
private final Location loc
-
work
private final GoodsType work
-
workAmount
private final int workAmount
-
movesLeft
private final int movesLeft
-
units
private final java.util.List<Unit> units
-
colony
private final Colony colony
-
-
Constructor Detail
-
UnitWas
public UnitWas(Unit unit)
Record the state of a unit.- Parameters:
unit- TheUnitto remember.
-
-
Method Detail
-
getUnit
public Unit getUnit()
-
getLocation
public Location getLocation()
-
getWorkType
public GoodsType getWorkType()
-
fireChanges
public boolean fireChanges()
Fire any property changes resulting from actions of a unit.- Returns:
- True if something changed.
-
change
private java.lang.String change(FreeColGameObject fcgo)
-
compareTo
public int compareTo(UnitWas uw)
- Specified by:
compareToin interfacejava.lang.Comparable<UnitWas>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-