|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.freecol.common.model.FreeColObject
net.sf.freecol.common.model.FreeColGameObject
net.sf.freecol.common.model.Region
public class Region
A named region on the map.
Nested Class Summary | |
---|---|
static class |
Region.RegionType
|
Field Summary | |
---|---|
static java.lang.String |
PACIFIC_NAME_KEY
|
Fields inherited from class net.sf.freecol.common.model.FreeColObject |
---|
ID_ATTRIBUTE_TAG |
Constructor Summary | |
---|---|
Region(Game game)
Creates a new Region instance. |
|
Region(Game game,
java.lang.String id)
Creates a new Region instance. |
|
Region(Game game,
javax.xml.stream.XMLStreamReader in)
Initiates a new Region from an XML representation. |
Method Summary | |
---|---|
void |
discover(Player player,
Turn turn,
java.lang.String newName)
Mark the Region as discovered. |
java.util.List<Region> |
getChildren()
Get the Children value. |
Region |
getDiscoverableRegion()
Returns a discoverable Region or null. |
Player |
getDiscoveredBy()
Get the DiscoveredBy value. |
Turn |
getDiscoveredIn()
Get the DiscoveredIn value. |
java.lang.String |
getDisplayName()
Returns the name or default name of this Region. |
java.lang.String |
getName()
Get the Name value. |
java.lang.String |
getNameKey()
Get the NameKey value. |
Region |
getParent()
Get the Parent value. |
int |
getScoreValue()
Get the ScoreValue value. |
Region.RegionType |
getType()
Get the Type value. |
java.lang.String |
getTypeName()
|
static java.lang.String |
getXMLElementTagName()
Gets the tag name of the root element representing this object. |
boolean |
isClaimable()
Get the Claimable value. |
boolean |
isDiscoverable()
Get the Discoverable value. |
boolean |
isLeaf()
Returns true if this is a leaf node. |
boolean |
isPacific()
Returns true if this Region is the Pacific
Ocean. |
boolean |
isPrediscovered()
Get the Prediscovered value. |
boolean |
isRoot()
Returns true if this is the whole map Region. |
void |
setChildren(java.util.List<Region> newChildren)
Set the Children value. |
void |
setClaimable(boolean newClaimable)
Set the Claimable value. |
void |
setDiscoverable(boolean newDiscoverable)
Set the Discoverable value. |
void |
setDiscoveredBy(Player newDiscoveredBy)
Set the DiscoveredBy value. |
void |
setDiscoveredIn(Turn newDiscoveredIn)
Set the DiscoveredIn value. |
void |
setName(java.lang.String newName)
Set the Name value. |
void |
setNameKey(java.lang.String newNameKey)
Set the NameKey value. |
void |
setParent(Region newParent)
Set the Parent value. |
void |
setPrediscovered(boolean newPrediscovered)
Set the Prediscovered value. |
void |
setScoreValue(int newScoreValue)
Set the ScoreValue value. |
void |
setType(Region.RegionType newType)
Set the Type value. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class net.sf.freecol.common.model.FreeColGameObject |
---|
addToRemoveElement, dispose, equals, equals, getFreeColGameObject, getFreeColGameObject, getGame, getGameOptions, getIntegerID, hashCode, hasID, isDisposed, isUninitialized, readFromXML, setGame, setId, toSavedXML, toXML, updateFreeColGameObject, updateID |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PACIFIC_NAME_KEY
Constructor Detail |
---|
public Region(Game game)
Region
instance.
game
- a Game
valuepublic Region(Game game, java.lang.String id)
Region
instance.
game
- a Game
valueid
- a String
valuepublic Region(Game game, javax.xml.stream.XMLStreamReader in) throws javax.xml.stream.XMLStreamException
Region
from an XML representation.
game
- The Game
this object belongs to.in
- The input stream containing the XML.
javax.xml.stream.XMLStreamException
- if an error occurred during parsing.Method Detail |
---|
public final java.lang.String getNameKey()
NameKey
value.
String
valuepublic final void setNameKey(java.lang.String newNameKey)
NameKey
value.
newNameKey
- The new NameKey value.public boolean isPacific()
true
if this Region is the Pacific
Ocean. The Pacific Ocean is special in so far as it is the only
Region that could be discovered in the original game.
boolean
valuepublic final java.lang.String getName()
Name
value.
getName
in interface Named
String
valuepublic final void setName(java.lang.String newName)
Name
value.
setName
in interface Nameable
newName
- The new Name value.public java.lang.String getDisplayName()
String
valuepublic java.lang.String getTypeName()
public final Region getParent()
Parent
value.
Region
valuepublic final void setParent(Region newParent)
Parent
value.
newParent
- The new Parent value.public final java.util.List<Region> getChildren()
Children
value.
List
valuepublic final void setChildren(java.util.List<Region> newChildren)
Children
value.
newChildren
- The new Children value.public final boolean isClaimable()
Claimable
value.
boolean
valuepublic final void setClaimable(boolean newClaimable)
Claimable
value.
newClaimable
- The new Claimable value.public final boolean isDiscoverable()
Discoverable
value.
boolean
valuepublic final void setDiscoverable(boolean newDiscoverable)
Discoverable
value.
newDiscoverable
- The new Discoverable value.public final boolean isPrediscovered()
Prediscovered
value.
boolean
valuepublic final void setPrediscovered(boolean newPrediscovered)
Prediscovered
value.
newPrediscovered
- The new Prediscovered value.public final int getScoreValue()
ScoreValue
value.
int
valuepublic final void setScoreValue(int newScoreValue)
ScoreValue
value.
newScoreValue
- The new ScoreValue value.public final Region.RegionType getType()
Type
value.
RegionType
valuepublic final void setType(Region.RegionType newType)
Type
value.
newType
- The new Type value.public boolean isRoot()
boolean
valuepublic boolean isLeaf()
boolean
valuepublic Region getDiscoverableRegion()
Region
valuepublic final Turn getDiscoveredIn()
DiscoveredIn
value.
Turn
valuepublic final void setDiscoveredIn(Turn newDiscoveredIn)
DiscoveredIn
value.
newDiscoveredIn
- The new DiscoveredIn value.public final Player getDiscoveredBy()
DiscoveredBy
value.
Player
valuepublic final void setDiscoveredBy(Player newDiscoveredBy)
DiscoveredBy
value.
newDiscoveredBy
- The new DiscoveredBy value.public void discover(Player player, Turn turn, java.lang.String newName)
player
- a Player
valueturn
- a Turn
valuenewName
- a String
valuepublic static java.lang.String getXMLElementTagName()
public java.lang.String toString()
FreeColGameObject
toString
in class FreeColGameObject
String
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |