dip.order
Class Retreat

java.lang.Object
  extended bydip.order.Order
      extended bydip.order.Move
          extended bydip.order.Retreat
All Implemented Interfaces:
Orderable, java.io.Serializable
Direct Known Subclasses:
GUIRetreat

public class Retreat
extends Move

Implementation of the Retreat order.

Note that a Retreat order is a Move order. Retreat orders are issued instead of Move orders during the Retreat phase, by OrderParser.

Convoy options are not valid in Retreat orders.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class dip.order.Move
_fmtIsAdjWithConvoy, _hasLandRoute, _isAdjWithPossibleConvoy, _isConvoyIntent, _isViaConvoy, convoyRoutes, dest
 
Fields inherited from class dip.order.Order
ORD_VAL_BORDER, power, src, srcUnitType
 
Constructor Summary
protected Retreat()
          Creates a Retreat order
protected Retreat(Power power, Location src, Unit.Type srcUnitType, Location dest)
          Creates a Retreat order
 
Method Summary
 void determineDependencies(Adjudicator adjudicator)
          Retreat orders are only dependent on other retreat orders that are moving to the same destination.
 boolean equals(java.lang.Object obj)
          Determines if the orders are equal.
 void evaluate(Adjudicator adjudicator)
          If a retreat is valid, it will be successfull unless there exists one or more retreats to the same destination.
 java.lang.String getFullName()
          Returns the Full name of the Order (e.g., "Hold" for a Hold order)
 boolean isByConvoy()
          Retreats are never convoyed; this will always return false.
 void validate(TurnState state, ValidationOptions valOpts, RuleOptions ruleOpts)
          Validate the order.
 void verify(Adjudicator adjudicator)
          No verification is performed.
 
Methods inherited from class dip.order.Move
formatConvoyRoute, formatConvoyRoute, getBriefName, getConvoyRoute, getConvoyRoutes, getDefaultFormat, getDest, isAdjWithPossibleConvoy, isConvoying, isConvoyIntent, isViaConvoy, toBriefString, toFullString, validateTheoreticalConvoyRoute
 
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
 

Constructor Detail

Retreat

protected Retreat(Power power,
                  Location src,
                  Unit.Type srcUnitType,
                  Location dest)
Creates a Retreat order


Retreat

protected Retreat()
Creates a Retreat order

Method Detail

isByConvoy

public boolean isByConvoy()
Retreats are never convoyed; this will always return false.


getFullName

public java.lang.String getFullName()
Description copied from interface: Orderable
Returns the Full name of the Order (e.g., "Hold" for a Hold order)

Specified by:
getFullName in interface Orderable
Overrides:
getFullName in class Move

equals

public boolean equals(java.lang.Object obj)
Description copied from class: Order
Determines if the orders are equal.

Note that full equality MUST be implemented for each subclassed Order object! Subclasses are advised to call the super method for assistance.

Overrides:
equals in class Move

validate

public void validate(TurnState state,
                     ValidationOptions valOpts,
                     RuleOptions ruleOpts)
              throws OrderException
Description copied from class: Order
Validate the 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.

Specified by:
validate in interface Orderable
Overrides:
validate in class Move
Throws:
OrderException

verify

public void verify(Adjudicator adjudicator)
No verification is performed.

Specified by:
verify in interface Orderable
Overrides:
verify in class Move

determineDependencies

public void determineDependencies(Adjudicator adjudicator)
Retreat orders are only dependent on other retreat orders that are moving to the same destination.

Specified by:
determineDependencies in interface Orderable
Overrides:
determineDependencies in class Move

evaluate

public void evaluate(Adjudicator adjudicator)
If a retreat is valid, it will be successfull unless there exists one or more retreats to the same destination.

Specified by:
evaluate in interface Orderable
Overrides:
evaluate in class Move


Copyright 2002-2004 Zachary DelProposto / jDip Development Team. All Rights Reserved.