|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdip.world.Border
A Border limits movement or support between 2 provinces.
A Border object is immutable.
The DTD for a Border object is:
<!ATTLIST BORDER
id ID #REQUIRED
description CDATA #REQUIRED
from CDATA #IMPLIED
unitTypes CDATA #IMPLIED
orderTypes CDATA #IMPLIED
year CDATA #IMPLIED
season CDATA #IMPLIED
phase CDATA #IMPLIED
baseMoveModifier CDATA #IMPLIED
>
Therefore, all fields are optional except for "id" and "description". If a field is not specified, it is assumed to apply to all types. Therefore: a border with a unitType of "Army" and year of "1900, 2000" would prohibit Armies from passing during the 1900 to 2000 years. However, if the unitType was omitted, no unit could pass (Army, Wing, or Fleet) from 1900 to 2000 years.
All specified items (except baseMoveModifier, thus from/unitTypes/ orderTypes/year/season/phase) must match for the Border to prohibit crossing.
Borders apply to ANY crossing; this includes Movement as well as Support.
Field Values:
Constructor Summary | |
Border(java.lang.String id,
java.lang.String description,
java.lang.String units,
Location[] from,
java.lang.String orders,
java.lang.String baseMoveModifier,
java.lang.String season,
java.lang.String phase,
java.lang.String year)
Constructor. |
Method Summary | |
boolean |
canTransit(Location fromLoc,
Unit.Type unit,
Phase phase,
java.lang.Class orderClass)
Determines if a unit can transit from a location to this location. |
boolean |
canTransit(Phase phase,
Order order)
Determines if a unit can transit from a location to this location. |
int |
getBaseMoveModifier(Location moveFrom)
Gets the base move modifier. |
java.lang.String |
getDescription()
Returns the description |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Border(java.lang.String id, java.lang.String description, java.lang.String units, Location[] from, java.lang.String orders, java.lang.String baseMoveModifier, java.lang.String season, java.lang.String phase, java.lang.String year) throws dip.world.InvalidBorderException
The from Locations may be null, if that field is empty.
InvalidBorderException
- if any arguments are invalid.
java.lang.IllegalArgumentException
- if id, description, or prohibited is nullMethod Detail |
public boolean canTransit(Phase phase, Order order)
Convenience method for more verbose canTransit() method. No arguments may be null.
public boolean canTransit(Location fromLoc, Unit.Type unit, Phase phase, java.lang.Class orderClass)
All defined border attributes have to match to prohibit border transit.
Null arguments are not permitted.
public int getBaseMoveModifier(Location moveFrom)
public java.lang.String getDescription()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |