|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.server.ai.AIObject
net.sf.freecol.server.ai.AIGoods
public class AIGoods
Objects of this class contains AI-information for a single Goods.
| Field Summary | |
|---|---|
static java.lang.String |
COPYRIGHT
|
static int |
FULL_DELIVERY
|
static int |
IMPORTANT_DELIVERY
|
static java.lang.String |
LICENSE
|
static java.lang.String |
REVISION
|
static int |
TOOLS_FOR_BUILDING
The extra priority value added to the base value of TOOLS_FOR_COLONY_PRIORITY
if a building is lacking tools. |
static int |
TOOLS_FOR_COLONY_PRIORITY
The priority of tools intended for a Colony with none stored at the present (and with no special needs). |
static int |
TOOLS_FOR_IMPROVEMENT
The extra priority value added to the base value of TOOLS_FOR_COLONY_PRIORITY
for each ColonyTile needing a terrain improvement. |
static int |
TOOLS_FOR_PIONEER
The extra priority value added to the base value of TOOLS_FOR_COLONY_PRIORITY
if a Pioneer is lacking tools |
| Fields inherited from class net.sf.freecol.server.ai.AIObject |
|---|
id, uninitialized |
| Constructor Summary | |
|---|---|
AIGoods(AIMain aiMain,
org.w3c.dom.Element element)
Creates a new AIGoods. |
|
AIGoods(AIMain aiMain,
Location location,
int type,
int amount,
Location destination)
Creates a new AIGoods. |
|
AIGoods(AIMain aiMain,
java.lang.String id)
Creates a new AIGoods. |
|
AIGoods(AIMain aiMain,
javax.xml.stream.XMLStreamReader in)
Creates a new AIGoods. |
|
| Method Summary | |
|---|---|
void |
abortWish(Wish w)
Aborts the given Wish. |
void |
dispose()
Disposes this object. |
Goods |
getGoods()
Gets the goods this AIGoods is controlling. |
java.lang.String |
getID()
Returns the ID of this AIObject. |
AIUnit |
getTransport()
Gets the carrier responsible for transporting this Transportable. |
Location |
getTransportDestination()
Returns the destination for this Transportable. |
Locatable |
getTransportLocatable()
Gets the Locatable which should be transported. |
int |
getTransportPriority()
Gets the priority of transporting this Transportable
to it's destination. |
Location |
getTransportSource()
Returns the source for this Transportable. |
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
void |
increaseTransportPriority()
Increases the transport priority of this Transportable. |
protected void |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
Reads information for this object from an XML stream. |
void |
setGoods(Goods goods)
Sets the goods this AIGoods is controlling. |
void |
setTransport(AIUnit transport)
Sets the carrier responsible for transporting this Transportable. |
void |
setTransportPriority(int transportPriority)
Sets the priority of getting the goods to the getTransportDestination(). |
java.lang.String |
toString()
Returns a String-representation of this object. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
Writes this object to an XML stream. |
| Methods inherited from class net.sf.freecol.server.ai.AIObject |
|---|
getAIMain, getGame, getRandom, isUninitialized, readFromXML, readFromXMLElement, toXML, toXMLElement |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String COPYRIGHT
public static final java.lang.String LICENSE
public static final java.lang.String REVISION
public static final int IMPORTANT_DELIVERY
public static final int FULL_DELIVERY
public static final int TOOLS_FOR_COLONY_PRIORITY
public static final int TOOLS_FOR_IMPROVEMENT
TOOLS_FOR_COLONY_PRIORITY
for each ColonyTile needing a terrain improvement.
public static final int TOOLS_FOR_PIONEER
TOOLS_FOR_COLONY_PRIORITY
if a Pioneer is lacking tools
public static final int TOOLS_FOR_BUILDING
TOOLS_FOR_COLONY_PRIORITY
if a building is lacking tools. The number of tools
is also added to the total amount.
| Constructor Detail |
|---|
public AIGoods(AIMain aiMain,
Location location,
int type,
int amount,
Location destination)
AIGoods.
aiMain - The main AI-object.location - The location of the goods.type - The type of goods.amount - The amount of goods.destination - The destination of the goods. This is the
Location to which the goods should be transported.
public AIGoods(AIMain aiMain,
org.w3c.dom.Element element)
AIGoods.
aiMain - The main AI-object.element - An Element containing an
XML-representation of this object.
public AIGoods(AIMain aiMain,
javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
AIGoods.
aiMain - The main AI-object.in - The input stream containing the XML.
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
public AIGoods(AIMain aiMain,
java.lang.String id)
AIGoods.
aiMain - The main AI-object.id - The unique ID of this object.| Method Detail |
|---|
public void abortWish(Wish w)
Wish.
abortWish in interface Transportablew - The Wish to be aborted.public Location getTransportSource()
Transportable.
This is normally the location of the
locatable.
getTransportSource in interface TransportableTransportable.public Location getTransportDestination()
Transportable.
This can either be the target Tile of the transport
or the target for the entire Transportable's
mission. The target for the tansport is determined by
TransportMission in the latter case.
getTransportDestination in interface TransportableTransportable.public Locatable getTransportLocatable()
Locatable which should be transported.
getTransportLocatable in interface TransportableLocatable.public int getTransportPriority()
Transportable
to it's destination.
getTransportPriority in interface Transportablepublic void increaseTransportPriority()
Transportable.
This method gets called every turn the Transportable
have not been put on a carrier's transport list.
increaseTransportPriority in interface Transportablepublic AIUnit getTransport()
Transportable.
getTransport in interface TransportableAIUnit which has this Transportable
in it's transport list. This Transportable has not been
scheduled for transport if this value is null.public void dispose()
dispose in class AIObjectpublic void setTransport(AIUnit transport)
Transportable.
setTransport in interface Transportabletransport - The AIUnit which has this Transportable
in it's transport list. This Transportable has not been
scheduled for transport if this value is null.public void setTransportPriority(int transportPriority)
getTransportDestination().
transportPriority - The priority.public Goods getGoods()
AIGoods is controlling.
Goods.public void setGoods(Goods goods)
AIGoods is controlling.
goods - The Goods.public java.lang.String getID()
AIObject.
getID in interface TransportablegetID in class AIObject
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
toXMLImpl in class AIObjectout - 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 AIObjectin - The input stream with the XML.
javax.xml.stream.XMLStreamException - if there are any problems reading
from the stream.public java.lang.String toString()
String-representation of this object.
toString in class java.lang.ObjectString representing this objecy for debugging purposes.public static java.lang.String getXMLElementTagName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||