Package worldBuilder

Class TradeRoutes


  • public class TradeRoutes
    extends java.lang.Object
    Before we create a new TradeRoute (path from point A to point B) we want to make sure we do not already have that path. This class maintains lists of direct (and indirect) routes and does these checks before creating a new route. There are two constructors: the first is used by TerritoryEngine when the expanding set of Journeys encounters a Journey from another Territory. the second is used by Map.read() when we are simply re-loading routes that have already been defined (we know all the steps)
    • Field Detail

      • map

        public Map map
      • names

        public java.lang.String[] names
      • routes

        public java.util.LinkedList<TradeRoute> routes
      • indirects

        public java.util.LinkedList<TradeRoute> indirects
    • Constructor Detail

      • TradeRoutes

        public TradeRoutes​(Map map)
    • Method Detail

      • addCrossing

        public TradeRoute addCrossing​(Journey one,
                                      Journey other)
        record a cross-over between two territories
        Parameters:
        one - Journey point on one side
        other - Journey point on other side
        Returns:
        boolean (is this a new trade route)