Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.
      • fallback

        public boolean fallback
        Is the destination a fallback destination?
    • Constructor Detail

      • CargoPlan

        public CargoPlan()
    • 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 - The TransportableAIObject to deliver.
        carrier - The carrier Unit to use.
        destination - The destination Location 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.