|
||||||||||
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.server.ai.AIObject
net.sf.freecol.server.ai.ValuedAIObject
net.sf.freecol.server.ai.Wish
public abstract class Wish
Represents a need for something at a given Location
.
Field Summary |
---|
Fields inherited from class net.sf.freecol.common.model.FreeColObject |
---|
ID_ATTRIBUTE_TAG |
Constructor Summary | |
---|---|
Wish(AIMain aiMain,
org.w3c.dom.Element element)
Creates a new Wish from the given XML-representation. |
|
Wish(AIMain aiMain,
java.lang.String id)
Creates a new Wish . |
|
Wish(AIMain aiMain,
javax.xml.stream.XMLStreamReader in)
Creates a new Wish from the given XML-representation. |
Method Summary | |
---|---|
void |
dispose()
Disposes this AIObject by removing
any referances to this object. |
Location |
getDestination()
Gets the destination of this Wish . |
Transportable |
getTransportable()
Gets the Transportable assigned to this Wish . |
void |
setTransportable(Transportable transportable)
Assigns a Transportable to this Wish . |
boolean |
shouldBeStored()
Checks if this Wish needs to be stored in a savegame. |
Methods inherited from class net.sf.freecol.server.ai.ValuedAIObject |
---|
compareTo, getValue, setValue |
Methods inherited from class net.sf.freecol.server.ai.AIObject |
---|
getAIMain, getGame, getXMLElementTagName, isUninitialized, readFromXML |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Wish(AIMain aiMain, java.lang.String id)
Wish
.
aiMain
- The main AI-object.id
- The unique ID of this object.public Wish(AIMain aiMain, org.w3c.dom.Element element)
Wish
from the given XML-representation.
aiMain
- The main AI-object.element
- The root element for the XML-representation
of a Wish
.public Wish(AIMain aiMain, javax.xml.stream.XMLStreamReader in) throws javax.xml.stream.XMLStreamException
Wish
from the given XML-representation.
aiMain
- The main AI-object.in
- The input stream containing the XML.
javax.xml.stream.XMLStreamException
- if a problem was encountered
during parsing.Method Detail |
---|
public boolean shouldBeStored()
Wish
needs to be stored in a savegame.
public void setTransportable(Transportable transportable)
Transportable
to this Wish
.
transportable
- The Transportable
which should
realize this wish.getTransportable()
,
WishRealizationMission
public Transportable getTransportable()
Transportable
assigned to this Wish
.
Transportable
which will realize this wish,
or null
if none has been assigned.setTransportable(net.sf.freecol.server.ai.Transportable)
,
WishRealizationMission
public void dispose()
AIObject
by removing
any referances to this object.
dispose
in class AIObject
public Location getDestination()
Wish
.
Location
in which the
transportable
assigned to
this Wish
will have to reach.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |