Acerd Posted March 9, 2016 Posted March 9, 2016 This may sound stupid but how do I use this?Apparently I have to make a "Condition" but I don't really get it, can anyone explain?
Khaleesi Posted March 9, 2016 Posted March 9, 2016 This may sound stupid but how do I use this? Apparently I have to make a "Condition" but I don't really get it, can anyone explain? Example: public static void webWalkEvent(final INodeRouteFinder routeFinder, final Position position, final int treshold, final MethodProvider script) { WebWalkEvent event = new WebWalkEvent(routeFinder, position); event.setBreakCondition(new Condition() { @Override public boolean evaluate() { // Return when you want the event to break. return script.getMap().distance(position) <= treshold; } }); script.execute(event); } 5
Acerd Posted March 9, 2016 Author Posted March 9, 2016 Example: public static void webWalkEvent(final INodeRouteFinder routeFinder, final Position position, final int treshold, final MethodProvider script) { WebWalkEvent event = new WebWalkEvent(routeFinder, position); event.setBreakCondition(new Condition() { @Override public boolean evaluate() { // Return when you want the event to break. return script.getMap().distance(position) <= treshold; } }); script.execute(event); } Thanks a lot! 1