Acerd Posted March 9, 2016 Share 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? Quote Link to comment Share on other sites More sharing options...
Khaleesi Posted March 9, 2016 Share 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 Quote Link to comment Share on other sites More sharing options...
Acerd Posted March 9, 2016 Author Share 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 Quote Link to comment Share on other sites More sharing options...