|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dip.order.Order dip.order.Convoy
Implementation of the Convoy order.
Field Summary | |
protected Location |
convoyDest
|
protected Power |
convoyPower
|
protected Location |
convoySrc
|
protected Unit.Type |
convoyUnitType
|
Fields inherited from class dip.order.Order |
ORD_VAL_BORDER, power, src, srcUnitType |
Constructor Summary | |
protected |
Convoy()
Creates a Convoy order |
protected |
Convoy(Power power,
Location src,
Unit.Type srcUnit,
Location convoySrc,
Power convoyPower,
Unit.Type convoyUnitType,
Location convoyDest)
Creates a Convoy order |
Method Summary | |
void |
determineDependencies(Adjudicator adjudicator)
Dependencies for a Convoy order are: Moves to this space (to determine dislodgement) Supports to this space (only considered if attacked, to prevent dislodgement) |
boolean |
equals(java.lang.Object obj)
Determines if the orders are equal. |
void |
evaluate(Adjudicator adjudicator)
Convoy order evaluation logic |
java.lang.String |
getBriefName()
Returns the Brief name of the Order (e.g., "H" for a Hold order) |
Location |
getConvoyDest()
Returns the Location of the Convoy destination |
Power |
getConvoyedPower()
Returns the Power of the Unit we are Convoying. |
Location |
getConvoySrc()
Returns the Location of the Unit to be Convoyed |
Unit.Type |
getConvoyUnitType()
Returns the Unit Type of the Unit to be Convoyed Warning: this can be null, if no unit type was set, and no strict validation was performed (via validate() ). |
java.lang.String |
getDefaultFormat()
Get the default OrderFormat String used to custom-format orders. |
java.lang.String |
getFullName()
Returns the Full name of the Order (e.g., "Hold" for a Hold order) |
java.lang.String |
toBriefString()
Prints the entire order, in a brief syntax |
java.lang.String |
toFullString()
Prints the entire order, in a verbose syntax |
void |
validate(TurnState state,
ValidationOptions valOpts,
RuleOptions ruleOpts)
Validate the order. |
void |
verify(Adjudicator adjudicator)
Checks for matching Move orders. |
Methods inherited from class dip.order.Order |
addSupportsOfAndMovesToSource, appendBrief, appendFull, checkPower, checkSeasonAdjustment, checkSeasonMovement, checkSeasonRetreat, getPower, getSource, getSourceUnitType, getValidatedUnitType, toFormattedString, toString, validate |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Location convoySrc
protected Location convoyDest
protected Unit.Type convoyUnitType
protected Power convoyPower
Constructor Detail |
protected Convoy(Power power, Location src, Unit.Type srcUnit, Location convoySrc, Power convoyPower, Unit.Type convoyUnitType, Location convoyDest)
protected Convoy()
Method Detail |
public Location getConvoySrc()
public Unit.Type getConvoyUnitType()
validate()
).
public Power getConvoyedPower()
validate()
).
Important Note: This also may be null only when a saved game from 1.5.1 or prior versions are loaded into a recent version, since prior versions did not support this field.
public Location getConvoyDest()
public java.lang.String getFullName()
Orderable
public java.lang.String getBriefName()
Orderable
public java.lang.String getDefaultFormat()
Orderable
public java.lang.String toBriefString()
Orderable
public java.lang.String toFullString()
Orderable
public boolean equals(java.lang.Object obj)
Order
Note that full equality MUST be implemented for each subclassed Order object! Subclasses are advised to call the super method for assistance.
equals
in class Order
public void validate(TurnState state, ValidationOptions valOpts, RuleOptions ruleOpts) throws OrderException
Order
This checks the order for legality. An order is not considered to be well-formed until it has been validated. It validates locations (at the least), and other order syntax as appropriate, throwing exceptions if there is a conflict.
This is used by the UI to flag bad orders, as well as by the adjudicator to eliminate bad orders before processing.
Important Note:
The only state that should be assumed is the following: 1) orders for this power (if entered) 2) the positions of all units. Thus, the orders of units not controlled by this power may not be known (in multiplayer games, this information would not be available until adjudication took place). DO NOT assume order information for the units of any power other than that of this unit/order!
Usage Notes:
Subclasses should generally call super.validate() before performing additional validation.
There should be no side effects of calling validate() multiple times, nor should behavior differ between multiple calls of validate(), given the same order.
validate
in interface Orderable
validate
in class Order
state
- Current turn statevalOpts
- Current validation options
OrderException
public void verify(Adjudicator adjudicator)
public void determineDependencies(Adjudicator adjudicator)
public void evaluate(Adjudicator adjudicator)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |