Move duplicating code to functions.
Cleaner, nicer, easier to extend.
Details
Details
- Reviewers
- None
- Commits
- rP23536: Remove duplication in AttackPlan [Petra]
:)
Diff Detail
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
Comment Actions
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js | 324| 324| this.queue.empty(); | 325| 325| this.queueChamp.empty(); | 326| 326| this.queueSiege.empty(); | 327| |-} | | 327|+}; | 328| 328| | 329| 329| PETRA.AttackPlan.prototype.removeQueues = function(gameState) | 330| 330| { | | [NORMAL] ESLintBear (semi): | | Missing semicolon. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js | 331| 331| gameState.ai.queueManager.removeQueue("plan_" + this.name); | 332| 332| gameState.ai.queueManager.removeQueue("plan_" + this.name + "_champ"); | 333| 333| gameState.ai.queueManager.removeQueue("plan_" + this.name + "_siege"); | 334| |-} | | 334|+}; | 335| 335| | 336| 336| /** Adds a build order. If resetQueue is true, this will reset the queue. */ | 337| 337| PETRA.AttackPlan.prototype.addBuildOrder = function(gameState, name, unitStats, resetQueue) binaries/data/mods/public/simulation/ai/petra/attackPlan.js | 327| } | | [NORMAL] JSHintBear: | | Missing semicolon. binaries/data/mods/public/simulation/ai/petra/attackPlan.js | 334| } | | [NORMAL] JSHintBear: | | Missing semicolon. Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1865/display/redirect
Comment Actions
Successful build - Chance fights ever on the side of the prudent.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1866/display/redirect