Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback methods in RobotController #273

Open
kazimuth opened this issue Dec 29, 2016 · 0 comments
Open

Callback methods in RobotController #273

kazimuth opened this issue Dec 29, 2016 · 0 comments

Comments

@kazimuth
Copy link
Contributor

We currently allocate lots of arrays; that's slow.

It would be cool if we offered functions that took callbacks instead, like:

// in RobotController.java
void forEachInRange(float range, Consumer<ObjectInfo> function);
// in player code
void run(RobotController rc) {
  // ...
  rc.forEachInRange(10, (obj) => {
    System.out.println("I can see: "+obj);
  });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant