net.sf.freecol.common.model
Class NationOptions

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.model.NationOptions

public class NationOptions
extends FreeColObject


Nested Class Summary
static class NationOptions.Advantages
          National advantages for European players only.
static class NationOptions.NationState
          Nations may be available to all players, to AI players only, or to no players.
 
Field Summary
static int DEFAULT_NO_OF_EUROPEANS
          The default number of European nations.
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ID_ATTRIBUTE_TAG
 
Constructor Summary
NationOptions()
           
 
Method Summary
 boolean canSelectColors()
          Get the SelectColors value.
static NationOptions getDefaults()
          Describe getDefaults method here.
 NationOptions.Advantages getNationalAdvantages()
          Get the NationalAdvantages value.
 java.util.Map<Nation,NationOptions.NationState> getNations()
          Get the Nations value.
 NationOptions.NationState getNationState(Nation nation)
          Get the NationState value of a particular Nation.
static java.lang.String getXMLElementTagName()
           
 void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
          Initialize this object from an XML-representation of this object.
 void setNationalAdvantages(NationOptions.Advantages newNationalAdvantages)
          Set the NationalAdvantages value.
 void setNations(java.util.Map<Nation,NationOptions.NationState> newNations)
          Set the Nations value.
 void setNationState(Nation nation, NationOptions.NationState state)
          Set the NationState value of a particular Nation.
 void setSelectColors(boolean newSelectColors)
          Set the SelectColors value.
 java.lang.String toString()
           
 void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
          This method writes an XML-representation of this object to the given stream.
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, hasAbility, hasAttribute, hasListeners, readFromXML, readFromXMLElement, removePropertyChangeListener, removePropertyChangeListener, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, writeAttribute, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_NO_OF_EUROPEANS

public static final int DEFAULT_NO_OF_EUROPEANS
The default number of European nations.

See Also:
Constant Field Values
Constructor Detail

NationOptions

public NationOptions()
Method Detail

getNations

public final java.util.Map<Nation,NationOptions.NationState> getNations()
Get the Nations value.

Returns:
a Map value

setNations

public final void setNations(java.util.Map<Nation,NationOptions.NationState> newNations)
Set the Nations value.

Parameters:
newNations - The new Nations value.

getNationalAdvantages

public final NationOptions.Advantages getNationalAdvantages()
Get the NationalAdvantages value.

Returns:
an Advantages value

setNationalAdvantages

public final void setNationalAdvantages(NationOptions.Advantages newNationalAdvantages)
Set the NationalAdvantages value.

Parameters:
newNationalAdvantages - The new NationalAdvantages value.

canSelectColors

public final boolean canSelectColors()
Get the SelectColors value.

Returns:
a boolean value

setSelectColors

public final void setSelectColors(boolean newSelectColors)
Set the SelectColors value.

Parameters:
newSelectColors - The new SelectColors value.

getNationState

public final NationOptions.NationState getNationState(Nation nation)
Get the NationState value of a particular Nation.

Parameters:
nation - a Nation value
Returns:
a NationState value

setNationState

public final void setNationState(Nation nation,
                                 NationOptions.NationState state)
Set the NationState value of a particular Nation.

Parameters:
nation - a Nation value
state - a NationState value

getDefaults

public static final NationOptions getDefaults()
Describe getDefaults method here.

Returns:
a NationOptions value

readFromXMLImpl

public final void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
                           throws javax.xml.stream.XMLStreamException
Initialize this object from an XML-representation of this object.

Parameters:
in - The input stream with the XML.
Throws:
javax.xml.stream.XMLStreamException - if a problem was encountered during parsing.

toXMLImpl

public void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
               throws javax.xml.stream.XMLStreamException
This method writes an XML-representation of this object to the given stream.

Parameters:
out - The target stream.
Throws:
javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.

getXMLElementTagName

public static java.lang.String getXMLElementTagName()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object