Accessing Battle Results

Jump to navigation Jump to search
Revision as of 6 December 2012 at 02:26.
The highlighted comment was created in this revision.

Accessing Battle Results

There needs to be a way for a third party (e.g. RoboJogger) to access battle results (on the fly results highly preferable). It looks like I could use ScoreLog to read results from the XML result file after it is created, but it would be preferable to have a way to add a listener that is notified each time a new battle result is available. For example, RoboRunner might allow third parties to add their own BattleResultHandler in addition to or in replacement of the one RoboRunner uses internally. Thoughts?

    Skotty00:16, 6 December 2012

    Yep, that makes sense. I think when you're listening to RoboRunner, you might want some higher level data too, like avg score and number of battles. So I think adding a new / similar listener to the RoboRunner class makes more sense than just letting you add more custom instances of the existing BattleResultHandler. The new interface method could take the raw scores and elapsed time, as now, plus whatever other summary data you want. At the end of RoboRunner's BattleResultHandler.processResults(), we call the higher level listener, if it's been set.

    Does that sound about right?

      Voidious01:01, 6 December 2012
       

      Sounds good. Is this a change you would like to make or would you prefer I make the change and send it back to you for review?

        Skotty03:21, 6 December 2012
         

        I say just make the changes you need and go with it, and I can merge them into the main branch whenever. But I'm happy to look over stuff or even write up the interface if you need me to.

          Voidious03:26, 6 December 2012