|
|||||||||
| 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.Feature
public abstract class Feature
The Feature class encapsulates a bonus or penalty
that can be applied to any action within the game, most obviously
combat.
| Field Summary | |
|---|---|
private Turn |
firstTurn
The first Turn in which this Feature applies. |
private Turn |
lastTurn
The last Turn in which this Feature applies. |
private java.util.List<Scope> |
scopes
A list of Scopes limiting the applicability of this Feature. |
private FreeColGameObjectType |
source
The source of this Feature, e.g. |
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, logger, PARTIAL_ATTRIBUTE |
| Constructor Summary | |
|---|---|
Feature()
|
|
| Method Summary | |
|---|---|
boolean |
appliesTo(FreeColGameObjectType objectType)
Returns true if the appliesTo method of at least
one Scope object returns true. |
boolean |
appliesTo(FreeColGameObjectType objectType,
Turn turn)
Returns true if the appliesTo method of at least
one Scope object returns true. |
boolean |
equals(java.lang.Object o)
|
Turn |
getFirstTurn()
Get the firstTurn value. |
Turn |
getLastTurn()
Get the LastTurn value. |
java.util.List<Scope> |
getScopes()
Get the Scopes value. |
FreeColGameObjectType |
getSource()
Get the Source value. |
int |
hashCode()
|
boolean |
hasScope()
Get the Scope value. |
boolean |
hasTimeLimit()
Get the TimeLimit value. |
boolean |
isOutOfDate(Turn turn)
Returns true if the Feature has an lastTurn turn smaller than the turn given. |
protected void |
readAttributes(javax.xml.stream.XMLStreamReader in,
Specification specification)
|
protected void |
readChildren(javax.xml.stream.XMLStreamReader in)
|
protected void |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in,
Specification specification)
Initialize this object from an XML-representation of this object. |
void |
setFirstTurn(Turn newFirstTurn)
Set the firstTurn value. |
void |
setLastTurn(Turn newLastTurn)
Set the LastTurn value. |
void |
setScopes(java.util.List<Scope> newScopes)
Set the Scopes value. |
void |
setSource(FreeColGameObjectType newSource)
Set the Source value. |
protected void |
writeAttributes(javax.xml.stream.XMLStreamWriter out)
|
protected void |
writeChildren(javax.xml.stream.XMLStreamWriter out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private FreeColGameObjectType source
private Turn firstTurn
private Turn lastTurn
private java.util.List<Scope> scopes
| Constructor Detail |
|---|
public Feature()
| Method Detail |
|---|
public final boolean hasTimeLimit()
TimeLimit value.
boolean valuepublic final boolean hasScope()
Scope value.
boolean valuepublic final java.util.List<Scope> getScopes()
Scopes value.
List valuepublic final void setScopes(java.util.List<Scope> newScopes)
Scopes value.
newScopes - The new Scopes value.public final Turn getFirstTurn()
firstTurn value.
Turn valuepublic final void setFirstTurn(Turn newFirstTurn)
firstTurn value.
newFirstTurn - The new FirstTurn value.public final Turn getLastTurn()
LastTurn value.
Turn valuepublic final void setLastTurn(Turn newLastTurn)
LastTurn value.
newLastTurn - The new LastTurn value.public final FreeColGameObjectType getSource()
Source value.
String valuepublic final void setSource(FreeColGameObjectType newSource)
Source value.
newSource - The new Source value.public boolean appliesTo(FreeColGameObjectType objectType)
appliesTo method of at least
one Scope object returns true.
objectType - a FreeColGameObjectType value
boolean value
public boolean appliesTo(FreeColGameObjectType objectType,
Turn turn)
appliesTo method of at least
one Scope object returns true.
objectType - a FreeColGameObjectType valueturn - a Turn value
boolean valuepublic boolean isOutOfDate(Turn turn)
turn - a Turn value
boolean valuepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object
protected void writeAttributes(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeAttributes in class FreeColObjectjavax.xml.stream.XMLStreamException
protected void writeChildren(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeChildren in class FreeColObjectjavax.xml.stream.XMLStreamException
protected void readFromXMLImpl(javax.xml.stream.XMLStreamReader in,
Specification specification)
throws javax.xml.stream.XMLStreamException
in - The input stream with the XML.specification - a Specification value
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
protected void readAttributes(javax.xml.stream.XMLStreamReader in,
Specification specification)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
protected void readChildren(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readChildren in class FreeColObjectjavax.xml.stream.XMLStreamException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||