#
Junjie
2 天以前 ff3b5df7015b2f2c5e24d9973a7b443309d8e579
src/main/java/com/zy/common/utils/NavigateSolution.java
@@ -5,6 +5,7 @@
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
import com.zy.common.model.NavigateNode;
import com.zy.common.model.enums.NavigationMapType;
import com.zy.core.enums.MapNodeType;
import com.zy.core.model.PythonResult;
import com.zy.system.entity.Config;
@@ -25,10 +26,10 @@
    int[][] map = {{}};
    public NavigateSolution(Integer mapType, Integer lev, List<int[]> whitePoints, List<int[]> shuttlePoints) {
    public NavigateSolution(List<NavigationMapType> mapTypes, Integer lev, List<int[]> whitePoints, List<int[]> shuttlePoints) {
        //载入地图指定层高地图
        NavigateMapData mapData = SpringUtils.getBean(NavigateMapData.class);
        int[][] data = mapData.getDataFromRedis(lev, mapType, whitePoints, shuttlePoints);
        int[][] data = mapData.getDataFromRedis(lev, mapTypes, whitePoints, shuttlePoints);
        if (data == null) {
            throw new CoolException("地图未载入!");
        }
@@ -195,11 +196,13 @@
                if (is_valid(x + 1, y))
                {
                    NavigateNode node = new NavigateNode(x + 1, y);
                    node.setNodeValue(map[x + 1][y]);
                    neighbour_node.add(node);
                }
                if (is_valid(x - 1, y))
                {
                    NavigateNode node = new NavigateNode(x -1, y);
                    NavigateNode node = new NavigateNode(x - 1, y);
                    node.setNodeValue(map[x - 1][y]);
                    neighbour_node.add(node);
                }
            }
@@ -209,11 +212,13 @@
                if (is_valid(x, y + 1))
                {
                    NavigateNode node = new NavigateNode(x, y + 1);
                    node.setNodeValue(map[x][y + 1]);
                    neighbour_node.add(node);
                }
                if (is_valid(x, y - 1))
                {
                    NavigateNode node = new NavigateNode(x, y - 1);
                    node.setNodeValue(map[x][y - 1]);
                    neighbour_node.add(node);
                }
            }
@@ -223,11 +228,13 @@
                if (is_valid(x, y + 1))
                {
                    NavigateNode node = new NavigateNode(x, y + 1);
                    node.setNodeValue(map[x][y + 1]);
                    neighbour_node.add(node);
                }
                if (is_valid(x, y - 1))
                {
                    NavigateNode node = new NavigateNode(x, y - 1);
                    node.setNodeValue(map[x][y - 1]);
                    neighbour_node.add(node);
                }
            }
@@ -237,11 +244,13 @@
                if (is_valid(x + 1, y))
                {
                    NavigateNode node = new NavigateNode(x + 1, y);
                    node.setNodeValue(map[x + 1][y]);
                    neighbour_node.add(node);
                }
                if (is_valid(x - 1, y))
                {
                    NavigateNode node = new NavigateNode(x -1, y);
                    NavigateNode node = new NavigateNode(x - 1, y);
                    node.setNodeValue(map[x - 1][y]);
                    neighbour_node.add(node);
                }
            }