|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dip.order.Order dip.order.Build
Implementation of the Build order.
Field Summary |
Fields inherited from class dip.order.Order |
ORD_VAL_BORDER, power, src, srcUnitType |
Constructor Summary | |
protected |
Build()
Creates a Build order |
protected |
Build(Power power,
Location src,
Unit.Type srcUnit)
Creates a Build order |
Method Summary | |
void |
determineDependencies(Adjudicator adjudicator)
Empty method: Build orders do not require dependency determination. |
boolean |
equals(java.lang.Object obj)
Determines if the orders are equal. |
void |
evaluate(Adjudicator adjudicator)
Build 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)
Builds: Builds are valid if: supply center is owned by this power supply centers is home to this power province contains no unit can build unit of that type in said province if fleet specified, coast must be valid default to army if no type specified AND supply center is inland otherwise build fails. |
void |
verify(Adjudicator adjudicator)
Empty method: Build 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 |
protected Build(Power power, Location src, Unit.Type srcUnit)
protected Build()
Method Detail |
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
Builds are valid if:
Validation is different than that of most other orders, since there is no unit present.
If builds not in home supply centers are allowed, restriction #2 above is waived.
WARNING: if the "build in any owned sc if one (or more) home sc is owned" rule is in place, this method does NOT currently check and reject the order if no home supply centers are owned. However, no units are allowed to be built in that case anyway, so the adjustments should be 0.
NOTE: validate() cannot take care of state-dependent order problems (since validate() cannot know what other orders have been submitted), such as if too many build orders are submitted. verify() could, but currently does not.
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)
If there are too few build orders, that is ok. If there are too many build orders, extra build orders must be discarded by the Adjustment adjudicator as appropriate.
Extra build orders are NOT considered in the evaluate() method here.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |