|
||||||||||
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.AIGoods
public class AIGoods
Objects of this class contains AI-information for a single Goods
.
Field Summary | |
---|---|
static int |
FULL_DELIVERY
|
static int |
IMPORTANT_DELIVERY
|
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.common.model.FreeColObject |
---|
ID_ATTRIBUTE_TAG |
Constructor Summary | |
---|---|
AIGoods(AIMain aiMain,
org.w3c.dom.Element element)
Creates a new AIGoods . |
|
AIGoods(AIMain aiMain,
Location location,
GoodsType 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. |
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 . |
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. |
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 |
Methods inherited from interface net.sf.freecol.server.ai.Transportable |
---|
getId |
Field Detail |
---|
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, GoodsType 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 Transportable
w
- The Wish
to be aborted.public Location getTransportSource()
Transportable
.
This is normally the location of the
locatable
.
getTransportSource
in interface Transportable
Transportable
.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 Transportable
Transportable
.public Locatable getTransportLocatable()
Locatable
which should be transported.
getTransportLocatable
in interface Transportable
Locatable
.public int getTransportPriority()
Transportable
to it's destination.
getTransportPriority
in interface Transportable
public void increaseTransportPriority()
Transportable
.
This method gets called every turn the Transportable
have not been put on a carrier's transport list.
increaseTransportPriority
in interface Transportable
public AIUnit getTransport()
Transportable
.
getTransport
in interface Transportable
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 dispose()
dispose
in class AIObject
public void setTransport(AIUnit transport)
Transportable
.
setTransport
in interface Transportable
transport
- 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 toString()
String
-representation of this object.
toString
in class java.lang.Object
String
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 |