@Polakrity asked on D2400 if the timer interval could be made configurable for Trickle as well, this patch does that
Details
- Reviewers
Freagarach - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) - Commits
- rP23879: Allow the interval to be changed in the templates for the Resource Trickle…
- Trac Tickets
- #5632
Add a modifier for interval, check everything works correctly and that update is more or less frequent.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2349/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2350/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1818/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/1819/display/redirect
binaries/data/mods/public/simulation/components/ResourceTrickle.js | ||
---|---|---|
14 ↗ | (On Diff #12187) | This is not needed since it is computed in the check timer. |
18 ↗ | (On Diff #12187) | The name of the function is not what it does ^^ |
79 ↗ | (On Diff #12187) | One could cache the old value and do this.trickeInterval = Apply,,, directly? |
80 ↗ | (On Diff #12187) | Also check whether the interval is positive (and non-zero). |
84 ↗ | (On Diff #12187) | Comment not needed? |
87 ↗ | (On Diff #12187) | Move to the declaration. |
binaries/data/mods/public/simulation/components/ResourceTrickle.js | ||
---|---|---|
85 ↗ | (On Diff #12187) | Early return? |
Inlines.
binaries/data/mods/public/simulation/components/ResourceTrickle.js | ||
---|---|---|
87 ↗ | (On Diff #12187) | No, else we compute it in some cases for nothing :) |
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2067/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2600/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/968/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2068/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2601/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2069/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2602/display/redirect
binaries/data/mods/public/simulation/components/ResourceTrickle.js | ||
---|---|---|
79 ↗ | (On Diff #12187) | I guess one wants to store the trickleInterval even if it is zero? |
87 ↗ | (On Diff #12187) | But now you declare it in vain for some cases ;) |
binaries/data/mods/public/simulation/components/tests/test_ResourceTrickle.js | ||
99 ↗ | (On Diff #12612) | Do you need the OnUpdate? |
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/969/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/970/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2070/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2603/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2071/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2604/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/2072/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2605/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/971/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/972/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/973/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2606/display/redirect
Add comment inline cmpTimer, apparently JavaScript allows this, and EsLint does not complain
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2607/display/redirect
binaries/data/mods/public/simulation/components/ResourceTrickle.js | ||
---|---|---|
79 ↗ | (On Diff #12618) | || 0 not needed anymore (since you've set it on init now). |
81 ↗ | (On Diff #12618) | What happens when the oldTrickeInterval was 0 and we try here to cancel the invalidated timer? |
94 ↗ | (On Diff #12618) | invalidated before (or earlier) to note it did not become invalidated on this turn. |
Fix inlines
binaries/data/mods/public/simulation/components/ResourceTrickle.js | ||
---|---|---|
81 ↗ | (On Diff #12618) | [11:20:17] Stan: Freagarach, when you cancel a cancelled timer delete returns false instead of true [11:20:48] Freagarach: So we're okay :) |
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2608/display/redirect
- Tested in game, interval applied appropriately.
- Code looks good.
- Common use cases tested.