|
|||||||||
| 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.FreeColGameObjectType
net.sf.freecol.common.model.FoundingFather
public class FoundingFather
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 | |
|---|---|
private java.util.List<Event> |
events
Describe events here. |
private java.util.List<Scope> |
scopes
Players that want to elect this founding father must match all scopes. |
private FoundingFather.FoundingFatherType |
type
The type of this FoundingFather. |
private java.util.List<AbstractUnit> |
units
A list of AbstractUnits generated by this FoundingFather. |
private java.util.Map<UnitType,UnitType> |
upgrades
Holds the upgrades of Units caused by this FoundingFather. |
private int[] |
weight
The probability of this FoundingFather being offered for selection. |
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, logger, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG |
| Constructor Summary | |
|---|---|
FoundingFather(java.lang.String id,
Specification specification)
|
|
| Method Summary | |
|---|---|
void |
fixup09x()
Compatibility hack, called from the specification when it is finishing up. |
java.util.List<Event> |
getEvents()
Get the Events value. |
java.util.List<Scope> |
getScopes()
Get the Scopes value. |
FoundingFather.FoundingFatherType |
getType()
Return the type of this FoundingFather. |
java.lang.String |
getTypeKey()
Return the localized type of this FoundingFather. |
static java.lang.String |
getTypeKey(FoundingFather.FoundingFatherType type)
Return the localized type of the given 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. |
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
boolean |
isAvailableTo(Player player)
Returns true if this FoundingFather is available
to the Player given. |
protected void |
readAttributes(javax.xml.stream.XMLStreamReader in)
Reads the attributes of this object from an XML stream. |
protected void |
readChild(javax.xml.stream.XMLStreamReader in)
Reads a child object. |
protected void |
readChildren(javax.xml.stream.XMLStreamReader in)
Reads the children of this object from an XML stream. |
void |
setEvents(java.util.List<Event> newEvents)
Set the Events value. |
void |
setType(FoundingFather.FoundingFatherType type)
Return the type of this FoundingFather. |
void |
setUnits(java.util.List<AbstractUnit> newUnits)
Set the Units value. |
void |
setUpgrades(java.util.Map<UnitType,UnitType> newUpgrades)
Set the Upgrades value. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
Makes an XML-representation of this object. |
protected void |
writeAttributes(javax.xml.stream.XMLStreamWriter out)
Write the attributes of this object to a stream. |
protected void |
writeChildren(javax.xml.stream.XMLStreamWriter out)
Write the children of this object to a stream. |
| Methods inherited from class net.sf.freecol.common.model.FreeColGameObjectType |
|---|
addAbility, addModifier, applyDifficultyLevel, getDescriptionKey, getFeatureContainer, getIndex, getModifierIndex, getModifierIndex, getModifierSet, getNameKey, hasAbility, hasAbility, isAbstractType, setAbstractType, setFeatureContainer, setIndex, setModifierIndex, toString, toXMLImpl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private int[] weight
private FoundingFather.FoundingFatherType type
private java.util.List<Scope> scopes
private java.util.List<Event> events
private java.util.Map<UnitType,UnitType> upgrades
private java.util.List<AbstractUnit> units
| Constructor Detail |
|---|
public FoundingFather(java.lang.String id,
Specification specification)
| Method Detail |
|---|
public FoundingFather.FoundingFatherType getType()
public void setType(FoundingFather.FoundingFatherType type)
type - A new FoundingFatherType.public java.lang.String getTypeKey()
String valuepublic static java.lang.String getTypeKey(FoundingFather.FoundingFatherType type)
type - an int value
String valuepublic int getWeight(int age)
age - an int value
int valuepublic final java.util.List<AbstractUnit> getUnits()
Units value.
List valuepublic final void setUnits(java.util.List<AbstractUnit> newUnits)
Units value.
newUnits - The new Units value.public final java.util.List<Event> getEvents()
Events value.
List valuepublic final void setEvents(java.util.List<Event> newEvents)
Events value.
newEvents - The new Events value.public final java.util.List<Scope> getScopes()
Scopes value.
List valuepublic boolean isAvailableTo(Player player)
FoundingFather is available
to the Player given.
player - a Player value
boolean valuepublic final java.util.Map<UnitType,UnitType> getUpgrades()
Upgrades value.
Map valuepublic final void setUpgrades(java.util.Map<UnitType,UnitType> newUpgrades)
Upgrades value.
newUpgrades - The new Upgrades value.
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
toXMLImpl in class FreeColGameObjectTypeout - The output stream.
javax.xml.stream.XMLStreamException - if there are any problems writing to the
stream.
protected void writeAttributes(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeAttributes in class FreeColObjectout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing to
the stream.
protected void writeChildren(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeChildren in class FreeColGameObjectTypeout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing to
the stream.
protected void readAttributes(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readAttributes in class FreeColGameObjectTypein - The XML input stream.
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
protected void readChildren(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readChildren in class FreeColGameObjectTypein - The XML input stream.
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
protected void readChild(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readChild in class FreeColGameObjectTypein - The XML stream to read.
javax.xml.stream.XMLStreamException - if an error occurspublic void fixup09x()
public static java.lang.String getXMLElementTagName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||