|
|||||||||
| 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, INFINITY, logger, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG |
| 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. |
protected void |
copy(Feature other)
|
boolean |
equals(java.lang.Object o)
|
Turn |
getFirstTurn()
Get the firstTurn value. |
Turn |
getLastTurn()
Get the LastTurn value. |
java.lang.String |
getNameKey()
Describe getNameKey method here. |
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)
Reads the attributes of this object from an XML stream. |
protected void |
readChildren(javax.xml.stream.XMLStreamReader in,
Specification specification)
Reads the children of this object from an XML stream. |
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)
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 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 java.lang.String getNameKey()
getNameKey method here.
String 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.Objectprotected void copy(Feature other)
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 FreeColObjectout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing
to the stream.
protected void readAttributes(javax.xml.stream.XMLStreamReader in,
Specification specification)
throws javax.xml.stream.XMLStreamException
readAttributes in class FreeColObjectin - The XML input stream.specification - A Specification to use.
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
protected void readChildren(javax.xml.stream.XMLStreamReader in,
Specification specification)
throws javax.xml.stream.XMLStreamException
readChildren in class FreeColObjectin - The XML input stream.specification - A Specification to use.
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||