Package net.sf.freecol.server.ai
Class Cargo.CargoPlan
- java.lang.Object
-
- net.sf.freecol.server.ai.Cargo.CargoPlan
-
- Enclosing class:
- Cargo
public static class Cargo.CargoPlan extends java.lang.Object
Container for a plan for a transportable to get to TWAIT where a carrier collects it from CWAIT (may equal TWAIT) and takes it to CDST, whence the transportable goes to TDST (may equal CDST).
-
-
Field Summary
Fields Modifier and Type Field Description Location
cdst
The key locations along the path taken by cargo and carrier.Location
cwait
The key locations along the path taken by cargo and carrier.boolean
fallback
Is the destination a fallback destination?Cargo.CargoMode
mode
Current state of the plan.Location
tdst
The key locations along the path taken by cargo and carrier.int
turns
Expected total duration of this plan when it is initialized.Location
twait
The key locations along the path taken by cargo and carrier.
-
Constructor Summary
Constructors Constructor Description CargoPlan()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
initialize(TransportableAIObject t, Unit carrier, Location destination, boolean allowFallback)
Plan the transport of a transportable with a given carrier.
-
-
-
Field Detail
-
twait
public Location twait
The key locations along the path taken by cargo and carrier.
-
cwait
public Location cwait
The key locations along the path taken by cargo and carrier.
-
cdst
public Location cdst
The key locations along the path taken by cargo and carrier.
-
tdst
public Location tdst
The key locations along the path taken by cargo and carrier.
-
turns
public int turns
Expected total duration of this plan when it is initialized.
-
mode
public Cargo.CargoMode mode
Current state of the plan.
-
fallback
public boolean fallback
Is the destination a fallback destination?
-
-
Method Detail
-
initialize
public java.lang.String initialize(TransportableAIObject t, Unit carrier, Location destination, boolean allowFallback)
Plan the transport of a transportable with a given carrier.- Parameters:
t
- TheTransportableAIObject
to deliver.carrier
- The carrierUnit
to use.destination
- The destinationLocation
to take the transportable to, using the transport destination if null.allowFallback
- Allow a fallback plan that does not complete the transport but does at least improve matters.- Returns:
- Null on success, an error message on failure.
-
-