implemented PathFinder, that searches for possible routes to a destinationblock

This commit is contained in:
Stephan Richter
2020-11-12 11:40:03 +01:00
parent d8a3629446
commit 69fdd3a805
7 changed files with 142 additions and 60 deletions

View File

@@ -293,7 +293,7 @@ public abstract class Block extends StretchableTile{
@Override
public String toString() {
return getClass().getSimpleName()+"("+name+") @ ("+x+","+y+")";
return name + " @ ("+x+","+y+")";
}
@Override

View File

@@ -240,7 +240,7 @@ public abstract class Tile extends BaseClass{
Tag routeList = new Tag("ol");
for (Route route : routes) {
String json = new JSONObject(Map.of(REALM,ROUTE,ID,route.id(),ACTION,ACTION_PROPS,CONTEXT,REALM_PLAN+":"+id())).toString().replace("\"", "'");
Tag li = new Tag("span").attr("onclick","return request("+json+");").content(route.name()+(route.isDisabled()?" ["+t("disabled")+"]" : "")+NBSP).addTo(new Tag("li").clazz("link"));
Tag li = new Tag("span").attr("onclick","return request("+json+");").content(route.shortName()+(route.isDisabled()?" ["+t("disabled")+"]" : "")+NBSP).addTo(new Tag("li").clazz("link"));
Map<String, Object> params = Map.of(REALM,REALM_ROUTE,ID,route.id(),ACTION,ACTION_DROP,Tile.class.getSimpleName(),id());
new Button(t("delete route"),params).addTo(li);
li.addTo(routeList);