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.ObjectContainer 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 LocationcdstThe key locations along the path taken by cargo and carrier.LocationcwaitThe key locations along the path taken by cargo and carrier.booleanfallbackIs the destination a fallback destination?Cargo.CargoModemodeCurrent state of the plan.LocationtdstThe key locations along the path taken by cargo and carrier.intturnsExpected total duration of this plan when it is initialized.LocationtwaitThe 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.Stringinitialize(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- TheTransportableAIObjectto deliver.carrier- The carrierUnitto use.destination- The destinationLocationto 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.
-
-