Adds statistics about the number of successful bribes a player have made, and show it in the miscellaneous page in the summary.
Details
- Reviewers
elexis Imarok - Commits
- rP20271: Add spies to the summary screen
Once you have made a successful bribe, close the game - to see the summary - should see the number updated.
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Patch looks good in general, but it doesn't work with teams (in gamesetup set teams to locked and give some players teams).
Either you have to extend the ugly hack we use to calculate team scores atm (look at calculateMiscellaneousTeam) or wait for D482.
binaries/data/mods/public/gui/summary/counters.js | ||
---|---|---|
75 | Why have you added it there? | |
99 | same | |
488 | newline missing? |
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
http://jenkins-master:8080/job/phabricator/1958/ for more details.
binaries/data/mods/public/gui/summary/counters.js | ||
---|---|---|
99 | This will be needed to gather team statistics. I used g_TeamHelperData[team].bribes to accumulate the number of bribes of each player in that team |
I think you shouldn't use g_TeamHelperData if it's not really needed and calculate the bribes when directly, like it's done for most of the team values.
(I think most of g_TeamHelperData should be removed sometimes)
What about also adding the number of failed bribes, as that also costs resource now?
(Could be done like the Sent/Received tributes)
Avoid using g_TeamHelperData and calculate team bribes when requested. Also, show stats about successful and failed bribes.
Summary screen
Yeah, sorry, I don't have that much time these days.
Though I'll review your patch this week.
It looks good at a first glance.
data/mods/public/gui/summary/counters.js | ||
---|---|---|
354–356 ↗ | (On Diff #3663) | not that important, but we could start with let i = 1 and therefor nuke that + 1 |
You should use the right root folder when creating patches.
(The paths of your current patch start with data/mods/public, while it should start with binaries/data/mods/public.)
The version before this had the right root folder.
For the requested changes please look some comments later ;)
You can also apply the patch by downloading it, entering the correct directory and using patch -p0 < filename`.
If you make him do work again, might as well leave some feedback here in advance.
Rest is good and works as proposed.
data/mods/public/gui/summary/counters.js | ||
---|---|---|
335 ↗ | (On Diff #3663) | any cause for inventing a new function? |
data/mods/public/gui/summary/layout.js | ||
187 ↗ | (On Diff #3663) | Remove the space between Bribes and \n to correctly center Bribes |
data/mods/public/simulation/components/tests/test_VisionSharing.js | ||
138 ↗ | (On Diff #3663) | => {} missing |
Used the summaryArraySum and getPlayerValuesPerTeam instead of writing my own function