Commit 2f713101 by 李进峰

is neighbour api update

parent f9a3e967
......@@ -306,10 +306,8 @@ public class GameEnv implements Serializable{
int y = this.mapNames.get(placeB);
if(this.mapGraph[x][y] == 1) {
return 1;
}else if(this.getAllPath(placeA, placeB).size()>1) {
return 2;
}else {
return 3;
return 2;
}
}
}
......@@ -357,12 +355,17 @@ public class GameEnv implements Serializable{
public List<String> queryPathBySite(String placeA, String placeB){
List<String> paths = this.getAllPath(placeA, placeB);
List<String> path = new ArrayList<String>();
for(int i=0; i<paths.size(); i++) {
if(i!=0&&i!=(paths.size()-1)) {
path.add(paths.get(i));
if(paths.size()>1) {
for(int i=0; i<paths.size(); i++) {
if(i!=0&&i!=(paths.size()-1)) {
path.add(paths.get(i));
}
}
return path;
}else {
return null;
}
return path;
}
/******************************************通过npc获取物品列表**********************************************/
// 通过npcName获取所有物品名称列表
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment