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 Colony
colony
private Location
loc
private static java.util.logging.Logger
logger
private int
movesLeft
private Role
role
private int
roleCount
private UnitType
type
private Unit
unit
private java.util.List<Unit>
units
private GoodsType
work
private int
workAmount
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
change(FreeColGameObject fcgo)
int
compareTo(UnitWas uw)
boolean
equals(java.lang.Object o)
boolean
fireChanges()
Fire any property changes resulting from actions of a unit.private int
getAmount(Location location, GoodsType goodsType)
Location
getLocation()
Unit
getUnit()
GoodsType
getWorkType()
int
hashCode()
java.lang.String
toString()
-
-
-
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
- TheUnit
to 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:
compareTo
in interfacejava.lang.Comparable<UnitWas>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-