net.sf.freecol.common.model
Class FoundingFather

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

public class FoundingFather
extends FreeColGameObjectType

Represents one FoundingFather to be contained in a Player object. The FoundingFather is able to grant new abilities or bonuses to the player, or to cause certain events.


Nested Class Summary
static class FoundingFather.FoundingFatherType
           
 
Field Summary
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ID_ATTRIBUTE_TAG
 
Constructor Summary
FoundingFather(int newIndex)
          Creates a new FoundingFather instance.
 
Method Summary
 java.util.Map<java.lang.String,java.lang.String> getEvents()
          Returns all events.
 FoundingFather.FoundingFatherType getType()
          Return the type of this FoundingFather.
 java.util.List<AbstractUnit> getUnits()
          Get the Units value.
 java.util.Map<UnitType,UnitType> getUpgrades()
          Get the Upgrades value.
 int getWeight(int age)
          Get the weight of this FoundingFather.
 boolean isAvailableTo(Player player)
          Returns true if this FoundingFather is available to the Player given.
 void readAttributes(javax.xml.stream.XMLStreamReader in, Specification specification)
           
 void readChildren(javax.xml.stream.XMLStreamReader in, Specification specification)
           
 void setEvents(java.util.Map<java.lang.String,java.lang.String> newEvents)
          Describe setEvents method here.
 void setUnits(java.util.List<AbstractUnit> newUnits)
          Set the Units value.
 void setUpgrades(java.util.Map<UnitType,UnitType> newUpgrades)
          Set the Upgrades value.
 
Methods inherited from class net.sf.freecol.common.model.FreeColGameObjectType
addAbility, addModifier, getFeatureContainer, getIndex, getModifierSet, hasAbility, hasAbility, readFromXML, setFeatureContainer, setIndex, toString
 
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, getXMLElementTagName, 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
 

Constructor Detail

FoundingFather

public FoundingFather(int newIndex)
Creates a new FoundingFather instance.

Parameters:
newIndex - an int value
Method Detail

getType

public FoundingFather.FoundingFatherType getType()
Return the type of this FoundingFather.

Returns:
an int value

getWeight

public int getWeight(int age)
Get the weight of this FoundingFather. This is used to select a random FoundingFather.

Parameters:
age - an int value
Returns:
an int value

getUnits

public final java.util.List<AbstractUnit> getUnits()
Get the Units value.

Returns:
a List value

setUnits

public final void setUnits(java.util.List<AbstractUnit> newUnits)
Set the Units value.

Parameters:
newUnits - The new Units value.

isAvailableTo

public boolean isAvailableTo(Player player)
Returns true if this FoundingFather is available to the Player given.

Parameters:
player - a Player value
Returns:
a boolean value

getUpgrades

public final java.util.Map<UnitType,UnitType> getUpgrades()
Get the Upgrades value.

Returns:
a Map value

setUpgrades

public final void setUpgrades(java.util.Map<UnitType,UnitType> newUpgrades)
Set the Upgrades value.

Parameters:
newUpgrades - The new Upgrades value.

getEvents

public java.util.Map<java.lang.String,java.lang.String> getEvents()
Returns all events.

Returns:
a List of Events.

setEvents

public void setEvents(java.util.Map<java.lang.String,java.lang.String> newEvents)
Describe setEvents method here.


readAttributes

public void readAttributes(javax.xml.stream.XMLStreamReader in,
                           Specification specification)
                    throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

readChildren

public void readChildren(javax.xml.stream.XMLStreamReader in,
                         Specification specification)
                  throws javax.xml.stream.XMLStreamException
Overrides:
readChildren in class FreeColGameObjectType
Throws:
javax.xml.stream.XMLStreamException