Class RoutePlanner

  • Direct Known Subclasses:
    ShipRoutePlanner

    public class RoutePlanner
    extends java.lang.Object
    Base class for route planners that show a dialog and add movement orders to units.
    Author:
    stm
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  RoutePlanner.Costs
      An abstract function that calculates route costs.
      static class  RoutePlanner.ZeroCosts
      A cost function that never exhausts.
    • Constructor Summary

      Constructors 
      Constructor Description
      RoutePlanner()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int addOrders​(java.util.List<java.lang.String> orders, java.util.List<Region> path, int mode, boolean useVorlage, RoutePlanner.Costs costs)
      Creates unit movement orders using the cost function provided as argument.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ZERO_COSTS

        public static final RoutePlanner.Costs ZERO_COSTS
        A cost function which never exhausts.
      • MODE_CONTINUOUS

        public static final int MODE_CONTINUOUS
        mode for ROUTE routes
        See Also:
        Constant Field Values
      • MODE_RETURN

        public static final int MODE_RETURN
        mode for there and back routes
        See Also:
        Constant Field Values
      • MODE_STOP

        public static final int MODE_STOP
        mode for stop after route is finished
        See Also:
        Constant Field Values
    • Constructor Detail

      • RoutePlanner

        public RoutePlanner()
    • Method Detail

      • addOrders

        public static int addOrders​(java.util.List<java.lang.String> orders,
                                    java.util.List<Region> path,
                                    int mode,
                                    boolean useVorlage,
                                    RoutePlanner.Costs costs)
        Creates unit movement orders using the cost function provided as argument.
        Parameters:
        orders - New orders will be appended to this list.
        path - The path to convert to orders
        mode - a combination of MODE_CONTINUOUS, MODE_RETURN, MODE_STOP
        useVorlage - Vorlage meta orders will be created if this is true.
        costs - A cost function specific to the kind of movement used.
        Returns:
        Number of added order lines
        See Also:
        RoutingDialogData