dip.order
Class Remove

java.lang.Object
  extended bydip.order.Order
      extended bydip.order.Remove
All Implemented Interfaces:
Orderable, java.io.Serializable
Direct Known Subclasses:
GUIRemove

public class Remove
extends Order

Implementation of the Remove order.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class dip.order.Order
ORD_VAL_BORDER, power, src, srcUnitType
 
Constructor Summary
protected Remove()
          Creates a Remove order
protected Remove(Power power, Location src, Unit.Type srcUnit)
          Creates a Remove order
 
Method Summary
 void determineDependencies(Adjudicator adjudicator)
          Empty method: Remove orders do not require dependency determination.
 boolean equals(java.lang.Object obj)
          Determines if the orders are equal.
 void evaluate(Adjudicator adjudicator)
          Remove orders are always successful.
 java.lang.String getBriefName()
          Returns the Brief name of the Order (e.g., "H" for a Hold order)
 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)
          Empty method: Remove orders do not require verification.
 
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

Remove

protected Remove(Power power,
                 Location src,
                 Unit.Type srcUnit)
Creates a Remove order


Remove

protected Remove()
Creates a Remove order

Method Detail

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)


getBriefName

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


getDefaultFormat

public java.lang.String getDefaultFormat()
Description copied from interface: Orderable
Get the default OrderFormat String used to custom-format orders.


toBriefString

public java.lang.String toBriefString()
Description copied from interface: Orderable
Prints the entire order, in a brief syntax


toFullString

public java.lang.String toFullString()
Description copied from interface: Orderable
Prints the entire order, in a verbose syntax


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 Order

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 Order
Parameters:
state - Current turn state
valOpts - Current validation options
Throws:
OrderException

verify

public void verify(Adjudicator adjudicator)
Empty method: Remove orders do not require verification.


determineDependencies

public void determineDependencies(Adjudicator adjudicator)
Empty method: Remove orders do not require dependency determination.


evaluate

public void evaluate(Adjudicator adjudicator)
Remove orders are always successful.

Note that too many (or two few) remove orders may be given; this must be handled by the adjustment adjudicator.



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