|
||||||||||
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.TileImprovementPlan
public class TileImprovementPlan
Represents a Tile
which should be improved in some way.
For instance by plowing or by building a road.
Tile
Field Summary |
---|
Fields inherited from class net.sf.freecol.common.model.FreeColObject |
---|
ID_ATTRIBUTE_TAG |
Constructor Summary | |
---|---|
TileImprovementPlan(AIMain aiMain,
org.w3c.dom.Element element)
Creates a new TileImprovementPlan from the given XML-representation. |
|
TileImprovementPlan(AIMain aiMain,
java.lang.String id)
Creates a new TileImprovementPlan from the given XML-representation. |
|
TileImprovementPlan(AIMain aiMain,
Tile target,
TileImprovementType type,
int value)
Creates a new TileImprovementPlan . |
|
TileImprovementPlan(AIMain aiMain,
javax.xml.stream.XMLStreamReader in)
Creates a new TileImprovementPlan from the given XML-representation. |
Method Summary | |
---|---|
void |
dispose()
Disposes this TileImprovementPlan . |
AIUnit |
getPioneer()
Gets the pioneer who have been assigned to making the improvement described by this object. |
Tile |
getTarget()
Gets the target of this TileImprovementPlan . |
TileImprovementType |
getType()
Returns the TileImprovementType of this plan. |
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
void |
setPioneer(AIUnit pioneer)
Sets the pioneer who have been assigned to making the improvement described by this object. |
void |
setType(TileImprovementType type)
Sets the type of this TileImprovementPlan . |
java.lang.String |
toString()
|
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, isUninitialized, readFromXML |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public TileImprovementPlan(AIMain aiMain, Tile target, TileImprovementType type, int value)
TileImprovementPlan
.
aiMain
- The main AI-object.target
- The target Tile
for the improvement.type
- The type of improvement.value
- The value identifying the importance of
this TileImprovementPlan
- a higher value
signals a higher importance.public TileImprovementPlan(AIMain aiMain, org.w3c.dom.Element element)
TileImprovementPlan
from the given XML-representation.
aiMain
- The main AI-object.element
- The root element for the XML-representation
of a Wish
.public TileImprovementPlan(AIMain aiMain, javax.xml.stream.XMLStreamReader in) throws javax.xml.stream.XMLStreamException
TileImprovementPlan
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.public TileImprovementPlan(AIMain aiMain, java.lang.String id) throws javax.xml.stream.XMLStreamException
TileImprovementPlan
from the given XML-representation.
aiMain
- The main AI-object.id
- The ID.
javax.xml.stream.XMLStreamException
- if a problem was encountered
during parsing.Method Detail |
---|
public void dispose()
TileImprovementPlan
.
If a pioneer has been assigned to making this improvement,
then this pioneer gets informed that the improvement is
no longer wanted.
dispose
in class AIObject
public AIUnit getPioneer()
AIUnit
has been assigned, and
null
if nobody has been assigned this
mission.public void setPioneer(AIUnit pioneer)
pioneer
- The pioneer which should make the improvement, if
such a Unit
has been assigned, and
null
if nobody has been assigned this
mission.public TileImprovementType getType()
TileImprovementType
of this plan.
public void setType(TileImprovementType type)
TileImprovementPlan
.
type
- The TileImprovementType
.getType()
public Tile getTarget()
TileImprovementPlan
.
Tile
where
pioneer
should make the
given improvement
.public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String getXMLElementTagName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |