Package worldBuilder
Class TradeRoutes
- java.lang.Object
-
- worldBuilder.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 Summary
Fields Modifier and Type Field Description java.util.LinkedList<TradeRoute>
indirects
Map
map
java.lang.String[]
names
Parameters
parms
java.util.LinkedList<TradeRoute>
routes
-
Constructor Summary
Constructors Constructor Description TradeRoutes(Map map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TradeRoute
addCrossing(Journey one, Journey other)
record a cross-over between two territories
-
-
-
Field Detail
-
map
public Map map
-
names
public java.lang.String[] names
-
parms
public Parameters parms
-
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 sideother
- Journey point on other side- Returns:
- boolean (is this a new trade route)
-
-