MCPcopy Create free account
hub / github.com/Neop/mudmap2 / getMeta

Method getMeta

src/main/java/mudmap2/frontend/WorldTab.java:373–400  ·  view source on GitHub ↗
(HashMap<Integer, Integer> layerTranslation)

Source from the content-addressed store, hash-verified

371 }
372
373 @Override
374 public JSONObject getMeta(HashMap<Integer, Integer> layerTranslation){
375 JSONObject root = new JSONObject();
376
377 MapPainterDefault mapPainter = (MapPainterDefault) getWorldPanel().getMappainter();
378 root.put("showPaths", mapPainter.getShowPaths());
379 root.put("pathsCurved", mapPainter.getPathsCurved());
380 root.put("showCursor", getWorldPanel().isCursorEnabled());
381 root.put("showGrid", mapPainter.isGridEnabled());
382 root.put("tileSize", getWorldPanel().getTileSize());
383
384 JSONArray history = new JSONArray();
385 root.put("history", history);
386
387 Integer cnt = 0;
388 for(WorldCoordinate coord: getWorldPanel().getHistory()){
389 if(layerTranslation.containsKey(coord.getLayer())){
390 JSONObject el = new JSONObject();
391 el.put("l", layerTranslation.get(coord.getLayer()));
392 el.put("x", coord.getX());
393 el.put("y", coord.getY());
394 history.put(el);
395 }
396 if(++cnt >= 25) break;
397 }
398
399 return root;
400 }
401
402 public void readMeta(){
403 WorldFile worldFile = getWorld().getWorldFile();

Callers

nothing calls this directly

Calls 13

getWorldPanelMethod · 0.95
getShowPathsMethod · 0.95
getPathsCurvedMethod · 0.95
isGridEnabledMethod · 0.95
getMappainterMethod · 0.80
putMethod · 0.80
isCursorEnabledMethod · 0.80
getHistoryMethod · 0.80
getMethod · 0.65
getXMethod · 0.65
getYMethod · 0.65
getTileSizeMethod · 0.45

Tested by

no test coverage detected