battlecode-server-2017
battlecode-server-2017 copied to clipboard
Callback methods in RobotController
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);
});
}