net.sf.freecol.server.ai
Interface Transportable

All Known Implementing Classes:
AIGoods, AIUnit

public interface Transportable

A single item in a carrier's transport list. Any Locatable which should be able to be transported by a carrier using the TransportMission, needs an AI object implementing this interface.

See Also:
TransportMission

Method Summary
 void abortWish(Wish w)
          Aborts the given Wish.
 java.lang.String getId()
          Returns the ID of the AIObject implementing this interface.
 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.
 void increaseTransportPriority()
          Increases the transport priority of this Transportable.
 void setTransport(AIUnit transport)
          Sets the carrier responsible for transporting this Transportable.
 

Method Detail

getTransportSource

Location getTransportSource()
Returns the source for this Transportable. This is normally the location of the locatable.

Returns:
The source for this Transportable.

getTransportDestination

Location getTransportDestination()
Returns the destination for this 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.

Returns:
The destination for this Transportable.

getTransportPriority

int getTransportPriority()
Gets the priority of transporting this Transportable to it's destination.

Returns:
The priority of the transport.

increaseTransportPriority

void increaseTransportPriority()
Increases the transport priority of this Transportable. This method gets called every turn the Transportable have not been put on a carrier's transport list.


getTransportLocatable

Locatable getTransportLocatable()
Gets the Locatable which should be transported.

Returns:
The Locatable.

getTransport

AIUnit getTransport()
Gets the carrier responsible for transporting this Transportable.

Returns:
The AIUnit which has this Transportable in it's transport list. This Transportable has not been scheduled for transport if this value is null.

setTransport

void setTransport(AIUnit transport)
Sets the carrier responsible for transporting this Transportable. This method should also add this Transportable to the given carrier's transport list.

Parameters:
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.

abortWish

void abortWish(Wish w)
Aborts the given Wish.

Parameters:
w - The Wish to be aborted.

getId

java.lang.String getId()
Returns the ID of the AIObject implementing this interface.

Returns:
The ID of the AIObject. This is normally the ID of the FreeColGameObject that object represents.