|
|||||||||
| 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
net.sf.freecol.server.ai.WorkerWish
public class WorkerWish
Represents the need for a worker within a Colony.
| Field Summary | |
|---|---|
private boolean |
expertNeeded
|
private static java.util.logging.Logger |
logger
|
private UnitType |
unitType
|
| Fields inherited from class net.sf.freecol.server.ai.Wish |
|---|
destination, transportable |
| Fields inherited from class net.sf.freecol.server.ai.AIObject |
|---|
uninitialized |
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG |
| Constructor Summary | |
|---|---|
WorkerWish(AIMain aiMain,
org.w3c.dom.Element element)
Creates a new WorkerWish from the given
XML-representation. |
|
WorkerWish(AIMain aiMain,
Location destination,
int value,
UnitType unitType,
boolean expertNeeded)
Creates a new WorkerWish. |
|
WorkerWish(AIMain aiMain,
java.lang.String id)
Creates a new WorkerWish from the given
XML-representation. |
|
WorkerWish(AIMain aiMain,
javax.xml.stream.XMLStreamReader in)
Creates a new WorkerWish from the given
XML-representation. |
|
| Method Summary | |
|---|---|
UnitType |
getUnitType()
Returns the type of unit needed for releasing this wish. |
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
protected void |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
Reads information for this object from an XML stream. |
java.lang.String |
toString()
|
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
Writes this object to an XML stream. |
void |
update(int value,
UnitType unitType,
boolean expertNeeded)
Updates this WorkerWish with the
given attributes. |
| Methods inherited from class net.sf.freecol.server.ai.Wish |
|---|
attachToDestination, dispose, getDestination, getDestinationAIColony, getTransportable, setTransportable, shouldBeStored |
| 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, getSpecification, isUninitialized, readFromXML |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
private UnitType unitType
private boolean expertNeeded
| Constructor Detail |
|---|
public WorkerWish(AIMain aiMain,
Location destination,
int value,
UnitType unitType,
boolean expertNeeded)
WorkerWish.
aiMain - The main AI-object.destination - The Location in which the
transportable assigned to
this WorkerWish will have to reach.value - The value identifying the importance of
this Wish.unitType - The type of unit needed for releasing this wish
completly.expertNeeded - Determines wether the unitType is
required or not.
public WorkerWish(AIMain aiMain,
org.w3c.dom.Element element)
WorkerWish from the given
XML-representation.
aiMain - The main AI-object.element - The root element for the XML-representation
of a WorkerWish.
public WorkerWish(AIMain aiMain,
java.lang.String id)
WorkerWish from the given
XML-representation.
aiMain - The main AI-object.id - The unique ID of this object.
public WorkerWish(AIMain aiMain,
javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
WorkerWish 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 void update(int value,
UnitType unitType,
boolean expertNeeded)
WorkerWish with the
given attributes.
value - The value identifying the importance of
this Wish.unitType - The type of unit needed for releasing this wish
completly.expertNeeded - Determines wether the unitType is
required or not.public UnitType getUnitType()
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
toXMLImpl in class FreeColObjectout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing
to the stream.
protected void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readFromXMLImpl in class FreeColObjectin - The input stream with the XML.
javax.xml.stream.XMLStreamException - if there are any problems reading
from the stream.public java.lang.String toString()
toString in class java.lang.Objectpublic static java.lang.String getXMLElementTagName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||