Commit 22549a7f by 李进峰

global variable update

parent 2555aef0
...@@ -41,7 +41,6 @@ public class GameEnv implements Serializable{ ...@@ -41,7 +41,6 @@ public class GameEnv implements Serializable{
// System.out.println(jsonString); // System.out.println(jsonString);
String jsonString = DBUtil.queryEnvJsonByBotName(botName); String jsonString = DBUtil.queryEnvJsonByBotName(botName);
Map<String, Object> gameProjectMap = JSON.parseObject(jsonString); Map<String, Object> gameProjectMap = JSON.parseObject(jsonString);
System.out.println(gameProjectMap);
this.followNpcIndex = new HashMap<String, NpcInstance>(); this.followNpcIndex = new HashMap<String, NpcInstance>();
this.placeLinkDirectGo = new HashMap<String, Place>(); this.placeLinkDirectGo = new HashMap<String, Place>();
this.placeNoLinkDirectGo = new HashMap<String, Place>(); this.placeNoLinkDirectGo = new HashMap<String, Place>();
...@@ -440,6 +439,7 @@ public class GameEnv implements Serializable{ ...@@ -440,6 +439,7 @@ public class GameEnv implements Serializable{
} }
return null; return null;
} }
public String queryCurPlaceGoodsInstanceByNickname(String curPlaceName, String nickname) { public String queryCurPlaceGoodsInstanceByNickname(String curPlaceName, String nickname) {
List<GoodsInstance> goodsInstances = this.placeIndex.get(curPlaceName).getGoodsInstances(); List<GoodsInstance> goodsInstances = this.placeIndex.get(curPlaceName).getGoodsInstances();
for(int i=0; i<goodsInstances.size();i++) { for(int i=0; i<goodsInstances.size();i++) {
...@@ -792,7 +792,6 @@ public class GameEnv implements Serializable{ ...@@ -792,7 +792,6 @@ public class GameEnv implements Serializable{
} }
} }
if(goodsInstanceBoolean) { if(goodsInstanceBoolean) {
System.out.print(goodsInstance);
List<Attr> attrs = goodsInstance.getAttrs(); List<Attr> attrs = goodsInstance.getAttrs();
if(names[3].equals("所在地点")) { if(names[3].equals("所在地点")) {
Place placeOrigin = goodsInstance.getPlace(); Place placeOrigin = goodsInstance.getPlace();
...@@ -894,8 +893,8 @@ public class GameEnv implements Serializable{ ...@@ -894,8 +893,8 @@ public class GameEnv implements Serializable{
return true; return true;
} }
} }
}else if(names.length == 3 && names[0].equals("globalVariable")) { }else if(names.length == 2 && names[0].equals("globalVariable")) {
this.globalAttrs.put(names[2], value); this.globalAttrs.put(names[1], value);
} }
return false; return false;
} }
......
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