|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.hagenah.diplomacy.map.Province
public final class Province
The Province class represents a province of a map. A province can have subprovinces, e.g. has the province Bulgaria the three subprovinces east coast, south coast, and land.
| Field Summary | |
|---|---|
static int |
SPECIAL_COASTALCONVOY
At this coast convoys are allowed - SpecialSubProvinces is null |
static int |
SPECIAL_GATEWAY
A gateway - SpecialSubProvinces are the gatekeeper subprovince and the two adjacent subprovinces |
static int |
SPECIAL_NORMAL
A normal province - SpecialSubProvinces is null |
static int |
SPECIAL_RAILWAY
A railway - SpecialSubProvinces are the subprovinces of the railway, SpecialCountry is the country that can use the railway |
static java.util.Comparator |
SUMMARY_CENTER_ORDER
Compares two provinces corresponding to the summary center order |
| Method Summary | |
|---|---|
boolean |
coastalConvoy()
Can a fleet at the coast of this land province convoy an army? |
int |
compareTo(java.lang.Object obj)
Compares two Provinces by Name ignoring case |
boolean |
equals(java.lang.Object obj)
Compares two Provinces by Name ignoring case |
java.lang.String |
getAbbreviation()
Returns the abbreviation of the province. |
Province |
getGatekeeper()
Returns the gatekeeper province for this gateway |
Province |
getGatewaySide(int side)
Returns a side of the gateway |
Province |
getGatewaySide(Province side)
Returns the other side of the gateway |
java.lang.String |
getName()
Returns the name of the province. |
java.util.List |
getRailway()
Returns the railway subprovinces |
java.util.List |
getRailway(SubProvince start,
SubProvince end)
Returns the railway subprovinces (except start) if an army moves from start to end. |
Country |
getRailwayOwner()
Return the owner of the railway (only his units can use it). |
int |
getSpecial()
Returns whether or not this province is a special province |
java.util.Collection |
getSpecialProvinces()
Returns all special provinces that influence this province. |
SubProvince |
getSubProvince(int coast)
Retrieves the SubProvince with the specified coast. |
SubProvince |
getSubProvince(java.lang.String coast)
Retrieves the SubProvince with the specified coast. |
java.util.SortedSet |
getSubProvinces()
Returns all SubProvinces. |
int |
hashCode()
Returns a hashcode for this Province. |
boolean |
hasSubProvince(int coast)
Has this province a SubProvince with the specified coast? |
boolean |
isCenter()
Is a center in the province? |
boolean |
isCenter(Country country)
Is this province a center for country? |
boolean |
isGateway()
Is this province a gateway? |
boolean |
isRailway()
Is this province a railway? |
boolean |
isSea()
Is it a sea province? |
java.lang.String |
toString()
Returns the name of the province |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.Comparator SUMMARY_CENTER_ORDER
public static final int SPECIAL_NORMAL
public static final int SPECIAL_RAILWAY
public static final int SPECIAL_GATEWAY
public static final int SPECIAL_COASTALCONVOY
| Method Detail |
|---|
public java.lang.String getName()
public java.lang.String getAbbreviation()
public boolean isSea()
public boolean isCenter()
public boolean isCenter(Country country)
country - The owner of the centerpublic java.util.SortedSet getSubProvinces()
public SubProvince getSubProvince(java.lang.String coast)
throws java.lang.IllegalArgumentException
coast - The Coast of the province (!=null).
java.lang.IllegalArgumentException
public SubProvince getSubProvince(int coast)
throws java.lang.IllegalArgumentException
coast - The Coast of the province.
java.lang.IllegalArgumentExceptionpublic boolean hasSubProvince(int coast)
coast - The Coast of the province.
public java.util.List getRailway()
java.lang.IllegalArgumentException - If this province isn't a railwaypublic Country getRailwayOwner()
public java.util.List getRailway(SubProvince start,
SubProvince end)
start - The current position of the army (must be part of the railway)end - The target of the army (must be part of the railway)
java.lang.IllegalArgumentException - If this province isn't a railwaypublic Province getGatekeeper()
java.lang.IllegalArgumentException - If this province isn't a gatewaypublic Province getGatewaySide(int side)
side - The side of the gateway (0 or 1)
java.lang.IllegalArgumentException - If this province isn't a gateway or side is not 0 or 1public Province getGatewaySide(Province side)
side - One side of the gateway
java.lang.IllegalArgumentException - If this province isn't a gateway or side is not a side of the gatewaypublic int getSpecial()
public java.util.Collection getSpecialProvinces()
public boolean isRailway()
public boolean isGateway()
public boolean coastalConvoy()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int compareTo(java.lang.Object obj)
compareTo in interface java.lang.Comparablepublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||