| | |
| | | package com.zy.common.utils; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.common.model.MapNode; |
| | | import com.zy.common.model.NavigateNode; |
| | | import com.zy.core.enums.ShuttleTaskModeType; |
| | | |
| | |
| | | //获取从x点到下一点的行走距离 |
| | | public static Integer getXToNextDistance(NavigateNode xNode) { |
| | | NavigateMapData mapData = new NavigateMapData(); |
| | | ArrayList<ArrayList<JSONObject>> lists = mapData.getJsonData(1); |
| | | List<List<MapNode>> lists = mapData.getJsonData(1); |
| | | if (lists != null) { |
| | | JSONObject jsonObject = lists.get(xNode.getX()).get(xNode.getY()); |
| | | if (jsonObject != null) { |
| | | return Integer.parseInt(jsonObject.getOrDefault(xNode.getDirection(), 0).toString()); |
| | | MapNode mapNode = lists.get(xNode.getX()).get(xNode.getY()); |
| | | if (mapNode != null) { |
| | | switch (xNode.getDirection()) { |
| | | case "top": |
| | | return mapNode.getTop(); |
| | | case "bottom": |
| | | return mapNode.getBottom(); |
| | | case "left": |
| | | return mapNode.getLeft(); |
| | | case "right": |
| | | return mapNode.getRight(); |
| | | } |
| | | } |
| | | return 0; |
| | | } |