Commit 955c5e93 by 李进峰

place update

parent 22549a7f
......@@ -866,35 +866,37 @@ public class GameEnv implements Serializable{
}else {
return false;
}
}else if(names[0].equals("place")) {
Place place = this.placeIndex.get(names[2]);
if(names[3].equals("到达条件")) {
place.setGoFlag(Integer.parseInt(value));
if(place.getGoFlag().equals(2)) {
this.placeLinkDirectGo.put(place.getName(),place);
this.placeNoLinkDirectGo.remove(place.getName());
}else if(place.getGoFlag().equals(3)) {
this.placeNoLinkDirectGo.put(place.getName(),place);
this.placeLinkDirectGo.remove(place.getName());
}
return true;
}else if(names[3].equals("可去地点")) {
String[] ableGos = value.split("~");
List<Place> places = new ArrayList<Place>();
byte[] line = this.mapGraph[this.mapNames.get(place.getName())];
for(int ag=0; ag<line.length; ag++) {
line[ag]=0;
}
for(int ag=0; ag<ableGos.length; ag++) {
places.add(this.placeIndex.get(ableGos[ag]));
line[this.mapNames.get(ableGos[ag])]=1;
}else if(names.length == 3 && names[0].equals("place")) {
Place place = this.placeIndex.get(names[1]);
if(names[2].equals("到达条件")) {
place.setGoFlag(Integer.parseInt(value));
if(place.getGoFlag().equals(1)) {
this.placeLinkDirectGo.put(place.getName(),place);
this.placeNoLinkDirectGo.remove(place.getName());
}else if(place.getGoFlag().equals(2)) {
this.placeNoLinkDirectGo.put(place.getName(),place);
this.placeLinkDirectGo.remove(place.getName());
}
return true;
}else if(names[2].equals("可去地点")) {
String[] ableGos = value.split("~");
List<Place> places = new ArrayList<Place>();
byte[] line = this.mapGraph[this.mapNames.get(place.getName())];
for(int ag=0; ag<line.length; ag++) {
line[ag]=0;
}
for(int ag=0; ag<ableGos.length; ag++) {
places.add(this.placeIndex.get(ableGos[ag]));
line[this.mapNames.get(ableGos[ag])]=1;
}
place.setAbleGo(places);
return true;
}else {
return false;
}
place.setAbleGo(places);
return true;
}
}else if(names[0].equals("globalVariable")) {
this.globalAttrs.put(names[1], value);
}
}else if(names.length == 2 && names[0].equals("globalVariable")) {
this.globalAttrs.put(names[1], value);
}
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