Accessing Battle Results

Fragment of a discussion from Talk:RoboJogger
Jump to navigation Jump to search

Yep, that makes sense. It' similar to what I have internally from RoboRunner to BattleRunner with the BattleRunner.BattleResultHandler interface. That's a pretty low level interface that BattleRunner calls after every battle, passing just raw scores and elapsed time. Then RoboRunner adds all the score processing / storing / displaying.

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 reasonable?

Voidious01:01, 6 December 2012