MCPcopy Create free account
hub / github.com/akeranen/the-one / setupMapData

Method setupMapData

test/MapBasedMovementTest.java:55–79  ·  view source on GitHub ↗
(String okTypes, String speed, String wTime)

Source from the content-addressed store, hash-verified

53 }
54
55 private void setupMapData(String okTypes, String speed, String wTime) {
56 Settings.init(null);
57 StringReader input = new StringReader(WKT);
58
59 WKTMapReader reader = new WKTMapReader(true);
60 try {
61 reader.addPaths(input, 0);
62 } catch (IOException e) {
63 fail(e.toString());
64 }
65
66 s = new TestSettings();
67 s.putSetting(MovementModel.SPEED, (speed != null ? speed : "1,1"));
68 s.putSetting(MovementModel.WAIT_TIME, (wTime != null ? wTime : "0,0"));
69
70 if (okTypes != null) {
71 s.putSetting(MapBasedMovement.MAP_SELECT_S, okTypes);
72 }
73 map = reader.getMap();
74 mbm = new MapBasedMovement(s, map, 3); // accepts types 1-3
75
76 n1 = map.getNodeByCoord(c1);
77 n2 = map.getNodeByCoord(c2);
78 n6 = map.getNodeByCoord(c6);
79 }
80
81 public void testGetPath() {
82 setupMapData(null,null,null);

Callers 4

testGetPathMethod · 0.95
testOneMapTypeNodeMethod · 0.95
testManyMapTypeNodesMethod · 0.95
testHostMovingMethod · 0.95

Calls 6

initMethod · 0.95
addPathsMethod · 0.95
getMapMethod · 0.95
putSettingMethod · 0.80
getNodeByCoordMethod · 0.80
toStringMethod · 0.65

Tested by

no test coverage detected