|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdip.world.Unit
A Unit is an object that has an owner (power), a coast location, and a Type describing that unit.
Units are placed in Provinces.
This object is not immutable!
Nested Class Summary | |
static class |
Unit.Type
A Type is the class of unit, for example, Army or Fleet. |
Field Summary | |
protected Coast |
coast
|
protected Power |
owner
|
protected Unit.Type |
type
|
Constructor Summary | |
Unit(Power power,
Unit.Type unitType)
Creates a new Unit |
Method Summary | |
java.lang.Object |
clone()
Returns a Clone of the unit. |
boolean |
equals(java.lang.Object obj)
Returns if two Units are equivalent. |
Coast |
getCoast()
Get the Coast where this Unit is located |
Power |
getPower()
Get the Power who controls this Unit |
Unit.Type |
getType()
Get the Type of unit (e.g., Army or Fleet) |
void |
setCoast(Coast coast)
Set the coast of a unit. |
java.lang.String |
toString()
Displays internal object values. |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final Unit.Type type
protected final Power owner
protected Coast coast
Constructor Detail |
public Unit(Power power, Unit.Type unitType)
Method Detail |
public void setCoast(Coast coast)
public Coast getCoast()
public Power getPower()
public Unit.Type getType()
public boolean equals(java.lang.Object obj)
public java.lang.Object clone()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |