use of delta.games.lotro.maps.data.Map in project lotro-tools by dmorcellet.
the class LinkCreationInterator method doLink.
private void doLink(MapBundle bundle, int x, int y) {
MapBundle currentMap = _canvas.getCurrentMap();
Map map = currentMap.getMap();
String target = bundle.getKey();
GeoPoint hotPoint = map.getGeoReference().pixel2geo(new Dimension(x, y));
MapLink link = new MapLink(target, hotPoint);
map.addLink(link);
_manager.saveMap(map.getKey());
_canvas.repaint();
}
use of delta.games.lotro.maps.data.Map in project lotro-tools by dmorcellet.
the class MapPageParser method parse.
/**
* Parse map data.
* @param mapBundle Storage for extracted data.
* @param js Input file.
*/
public void parse(MapBundle mapBundle, File js) {
List<String> lines = TextUtils.readAsLines(js);
Float startX = null;
Float startY = null;
Float scale = null;
Date date = null;
MarkersManager markers = mapBundle.getData();
int markerId = 1;
for (String line : lines) {
if (line.startsWith(STARTX_SEED)) {
// map.StartX = -42.8;
startX = getValue(STARTX_SEED, line);
} else if (line.startsWith(STARTY_SEED)) {
// map.StartY = 14.7;
startY = getValue(STARTY_SEED, line);
} else if (line.startsWith(SCALE2MAP_SEED)) {
// map.ScaleToMap = 3.498879;
scale = getValue(SCALE2MAP_SEED, line);
} else // map.ScaleToIg = 0.285807;
if (line.startsWith(MODIFIED_SEED)) {
// map.Modified = "07/12/2015";
date = getDate(MODIFIED_SEED, line);
} else if (line.startsWith("[")) {
Marker marker = parseItemLine(line);
if (marker != null) {
marker.setId(markerId);
markerId++;
markers.addMarker(marker);
}
}
}
Map map = mapBundle.getMap();
if ((startX != null) && (startY != null) && (scale != null)) {
GeoPoint start = new GeoPoint(startX.floatValue(), startY.floatValue());
GeoReference reference = new GeoReference(start, scale.floatValue());
map.setGeoReference(reference);
}
map.setLastUpdate(date);
}
Aggregations