|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.hagenah.diplomacy.game.Order
public final class Order
The following orders are supported.
| Field Summary | |
|---|---|
static int |
RESULT_BLOCKED
Gateway is blocked |
static int |
RESULT_BOUNCE
Move or retreat was not possible |
static int |
RESULT_CUT
Support was cut |
static int |
RESULT_DESTROYED
Unit was destroyed |
static int |
RESULT_DISLODGED
Unit was dislodged |
static int |
RESULT_NOCONVOY
Convoy was not possible |
static int |
RESULT_NOORDER
No order processed |
static int |
RESULT_VOID
Convoy or support was not possible |
static int |
TOSTRING_COUNTRY
Returns the country, e.g. |
static int |
TOSTRING_CSS
The CSS class color-? |
static int |
TOSTRING_HTML
Returns a xhtml text, e.g. → instead of -> |
static int |
TOSTRING_JUDGE
If TOSTRING_COUNTRY is set returns a judge compatible output, if TOSTRING_COUNTRY is not set returns a judge compatible input. |
static int |
TOSTRING_OWNER
Returns the owner of foreign units, e.g. |
static int |
TOSTRING_RESULT
Returns the result, e.g. |
static int |
TOSTRING_SHORT
Returns a short text , e.g. |
static int |
TYPE_BUILD
1 SubProvince |
static int |
TYPE_CONVOY
3 SubProvinces |
static int |
TYPE_DISBAND
1 SubProvinces |
static int |
TYPE_GATEWAY
3 SubProvinces |
static int |
TYPE_HOLD
1 SubProvince |
static int |
TYPE_MOVE
1 SubProvince |
static int |
TYPE_MOVECONVOY
2,3,... |
static int |
TYPE_MOVEGATEWAY
3 SubProvinces |
static int |
TYPE_MOVERAILWAY
3 SubProvinces |
static int |
TYPE_PROXY
1 SubProvince, |
static int |
TYPE_REMOVE
1 SubProvince |
static int |
TYPE_RETREAT
2 SubProvinces |
static int |
TYPE_SUPPORTHOLD
2 SubProvinces |
static int |
TYPE_SUPPORTMOVE
3 SubProvinces |
static int |
TYPE_WAIVE
0 SubProvinces |
static java.util.Comparator |
UNIQUE_ORDER
Compares two orders by Country and Province (waive orders are always different). |
| Constructor Summary | |
|---|---|
Order(Country country,
int type)
Creates a waive order. |
|
Order(Country country,
int type,
java.util.List subprovinces)
Creates an unambiguous moveconvoy order. |
|
Order(Country country,
int type,
SubProvince subprovince)
Creates a hold, disband, build, or remove order. |
|
Order(Country country,
int type,
SubProvince subprovince,
Country proxy)
Creates a proxy order. |
|
Order(Country country,
int type,
SubProvince from,
SubProvince to)
Creates a retreat, move, ambiguous moveconvoy, or supporthold order. |
|
Order(Country country,
int type,
SubProvince from,
SubProvince to,
int coasthint)
Creates a supporthold order with coasthint. |
|
Order(Country country,
int type,
SubProvince subprovince,
SubProvince from,
SubProvince to)
Creates a support, convoy, moverailway, movegateway, or gateway order. |
|
Order(Country country,
int type,
SubProvince subprovince,
SubProvince from,
SubProvince to,
int coasthint)
Creates a support order with a coast hint. |
|
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object obj)
Compares two Orders by Country, SubProvinces, CoastHint, Type, Proxy (all waive orders are different from each other) |
boolean |
equals(java.lang.Object obj)
Compares two Orders by Country, SubProvinces, Type, Proxy (all waive orders are different from each other) |
int |
getCoastHint()
Returns the coast hint (Coast.LAND if there is none). |
Country |
getCountry()
Returns the country who ordered this order. |
SubProvince |
getFirst()
Returns the first subprovince in the order. |
SubProvince |
getLast()
Returns the last subprovince in the order. |
Country |
getProxy()
Returns the country to which the unit is proxied. |
int |
getResult()
Returns the order result flags (combination of RESULT_...). |
SubProvince |
getSecond()
Returns the second subprovince in the order. |
SubProvince |
getSubProvince(int n)
Returns the n-th subprovince in the order. |
java.util.List |
getSubProvinces()
Returns the subprovinces in the order. |
int |
getType()
Returns the type of the order (TYPE_...). |
int |
hashCode()
Returns a hashcode for this unit. |
boolean |
isMove()
Returns true if the order is a move order (TYPE_MOVE...) |
boolean |
isSupport()
Returns true if the order is a support order (TYPE_SUPPORT...) |
java.lang.String |
toString()
Returns a description of the order, e.g. |
java.lang.String |
toString(int flags,
java.util.Map units)
Retrieves a text for the order. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int TOSTRING_COUNTRY
public static final int TOSTRING_OWNER
public static final int TOSTRING_RESULT
public static final int TOSTRING_SHORT
public static final int TOSTRING_JUDGE
public static final int TOSTRING_HTML
public static final int TOSTRING_CSS
public static final int TYPE_HOLD
public static final int TYPE_MOVE
public static final int TYPE_MOVECONVOY
public static final int TYPE_SUPPORTHOLD
public static final int TYPE_SUPPORTMOVE
public static final int TYPE_CONVOY
public static final int TYPE_PROXY
public static final int TYPE_RETREAT
public static final int TYPE_DISBAND
public static final int TYPE_BUILD
public static final int TYPE_REMOVE
public static final int TYPE_WAIVE
public static final int TYPE_MOVERAILWAY
public static final int TYPE_MOVEGATEWAY
public static final int TYPE_GATEWAY
public static final int RESULT_BOUNCE
public static final int RESULT_CUT
public static final int RESULT_DISLODGED
public static final int RESULT_DESTROYED
public static final int RESULT_NOCONVOY
public static final int RESULT_VOID
public static final int RESULT_NOORDER
public static final int RESULT_BLOCKED
public static final java.util.Comparator UNIQUE_ORDER
| Constructor Detail |
|---|
public Order(Country country,
int type)
public Order(Country country,
int type,
SubProvince subprovince)
public Order(Country country,
int type,
SubProvince subprovince,
Country proxy)
public Order(Country country,
int type,
SubProvince from,
SubProvince to)
public Order(Country country,
int type,
SubProvince from,
SubProvince to,
int coasthint)
public Order(Country country,
int type,
SubProvince subprovince,
SubProvince from,
SubProvince to)
public Order(Country country,
int type,
SubProvince subprovince,
SubProvince from,
SubProvince to,
int coasthint)
public Order(Country country,
int type,
java.util.List subprovinces)
| Method Detail |
|---|
public Country getCountry()
public int getType()
public boolean isMove()
public boolean isSupport()
public SubProvince getSubProvince(int n)
n - The zero-based index of the subprovince
public SubProvince getFirst()
public SubProvince getSecond()
public SubProvince getLast()
public java.util.List getSubProvinces()
public Country getProxy()
public int getCoastHint()
public int getResult()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int compareTo(java.lang.Object obj)
compareTo in interface java.lang.Comparablepublic int hashCode()
hashCode in class java.lang.Object
public java.lang.String toString(int flags,
java.util.Map units)
flags - TOSTRING_COUNTRY, TOSTRING_OWNER, TOSTRING_RESULT, TOSTRING_SHORT, TOSTRING_JUDGE, TOSTRING_HTML, TOSTRING_CSSunits - The units on the board (Province → Unit), can be null.
Needed if TOSTRING_OWNER is specified.
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||