Jump to content

setBreakCondition - WebWalkEvent


Recommended Posts

Posted

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);
}
  • Like 5
Posted

 

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!

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...