I've started on a "Melee Evaluater"...
First, a quick question: IS IT POSSIBLE to HAVE a, say on
ScannedRobot, from ANOTHER CLASS that HAS an ADVANCEDROBOT which is the
AdvancedRobot I'm trying to get the on
ScannedRobot from?
In other words, when an event occurs in a robot, can another class that has an instance (if my Java terminology is correct :) ) of the robot "catch" the event?
If not, then the bot will have to have "meleeeval.onHitRobot
?(e)", "meleeeval.onHitByBullet
?(e)", etc. which will make implementing the evaluater into bots harder...
--
Starrynte
Yes, you can do bot.getAllEvents?();. However, this has to be called after the execute() and some events will be ignored, eg. those with a priority of 100. You have to create an event that has a priority of 99 and put the event distribution code in there. -- Skilgannon
- Why would the events with 100 priority be ignored? and by after the execute(), do you mean to have a custom event that always returns true, set the customevent to priority 99, and then, in the customevent, tell the other class to do bot.getAllEvents?()? --Starrynte
- POST EDITED: It does work, except the win event, where I did a check to see if there were robots left to determine if the bot won :) i'll release the melee evaluater soon. (also added another stat) --Starrynte
- The reason it wouldn't work for the WinEvent? is because its priority is higher than you can set a custom event to, so it gets called before you can get it in getAllEvents?(). When it gets called it gets removed from the events que, so getAllEvents? doesn't include it. -- Skilgannon