This patch was primarily intended to add a "CannonShots" to the statistics in CannonKeep game mode: it counts the number of shots of the cannon when the player is controling it (regardless whether the ball hits the home planet or not).
I thus factorized the code that writes each column and added a column counter (int col).
So, it's now super-easy to add mode-specific columns w/o having to modify the formatting of the other columns.
The locales (apart from english and french) are screwed, however (and the french name could be better ... "Tirs du Cannon", maybe, but that's too long...).
I had to enlarge the columns (the column width could be factorized too, as a macro, btw.)
Oh, and I'm not entirely satisfied with the way how shots and counted (I added "Cannon" to the friends classes of Player...). It may be cleaner with a method call. It's one of the first time I write C++, so ...
Log in to post a comment.