|
||||||||||
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
net.sf.freecol.common.model.Ability
public final class Ability
The Ability
class encapsulates a bonus or penalty
that can be applied to any action within the game, most obviously
combat.
Field Summary | |
---|---|
static java.lang.String |
ADD_TAX_TO_BELLS
|
Fields inherited from class net.sf.freecol.common.model.FreeColObject |
---|
ID_ATTRIBUTE_TAG |
Constructor Summary | |
---|---|
Ability(org.w3c.dom.Element element)
Creates a new Ability instance. |
|
Ability(java.lang.String id)
Creates a new Ability instance. |
|
Ability(java.lang.String id,
boolean value)
Creates a new Ability instance. |
|
Ability(java.lang.String id,
FreeColGameObjectType source,
boolean value)
Creates a new Ability instance. |
|
Ability(javax.xml.stream.XMLStreamReader in,
Specification specification)
Creates a new Ability instance. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
boolean |
getValue()
Get the Value value. |
static java.lang.String |
getXMLElementTagName()
Returns the XML tag name for this element. |
int |
hashCode()
|
void |
readAttributes(javax.xml.stream.XMLStreamReader in,
Specification specification)
|
void |
setValue(boolean newValue)
Set the Value 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. |
void |
writeAttributes(javax.xml.stream.XMLStreamWriter out)
|
Methods inherited from class net.sf.freecol.common.model.Feature |
---|
appliesTo, appliesTo, getFirstTurn, getLastTurn, getScopes, getSource, hasScope, hasTimeLimit, isOutOfDate, setFirstTurn, setLastTurn, setScopes, setSource |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ADD_TAX_TO_BELLS
Constructor Detail |
---|
public Ability(java.lang.String id)
Ability
instance.
id
- a String
valuepublic Ability(java.lang.String id, boolean value)
Ability
instance.
id
- a String
valuevalue
- a boolean
valuepublic Ability(java.lang.String id, FreeColGameObjectType source, boolean value)
Ability
instance.
id
- a String
valuesource
- a FreeColGameObjectType
valuevalue
- a boolean
valuepublic Ability(org.w3c.dom.Element element)
Ability
instance.
element
- an Element
valuepublic Ability(javax.xml.stream.XMLStreamReader in, Specification specification) throws javax.xml.stream.XMLStreamException
Ability
instance.
in
- a XMLStreamReader
valuespecification
- a Specification
value
javax.xml.stream.XMLStreamException
- if an error occursMethod Detail |
---|
public boolean getValue()
Value
value.
boolean
valuepublic void setValue(boolean newValue)
Value
value.
newValue
- The new Value value.public int hashCode()
hashCode
in class Feature
public boolean equals(java.lang.Object o)
equals
in class Feature
public void toXMLImpl(javax.xml.stream.XMLStreamWriter out) throws javax.xml.stream.XMLStreamException
out
- The target stream.
javax.xml.stream.XMLStreamException
- if there are any problems writing
to the stream.public void readAttributes(javax.xml.stream.XMLStreamReader in, Specification specification) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public void writeAttributes(javax.xml.stream.XMLStreamWriter out) throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamException
public static java.lang.String getXMLElementTagName()
String
valuepublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |