rP23733 made it such that a ResourceGatherer takes a target to commit resources. This patch lets the unit actually drop their resources at the dropsite.
While at it also add some unit-tests for cmpResourceDropsite and cmpResourceGatherer.
Details
- Reviewers
- None
- Group Reviewers
Restricted Owners Package (Owns No Changed Paths) - Commits
- rP24543: Commit resources at dropsite and add tests.
Verify unmodified behaviour.
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 is green
builderr-debug-macos.txt ld: warning: text-based stub file /System/Library/Frameworks//CoreAudio.framework/CoreAudio.tbd and library file /System/Library/Frameworks//CoreAudio.framework/CoreAudio are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox.tbd and library file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback.tbd and library file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//CoreVideo.framework/CoreVideo.tbd and library file /System/Library/Frameworks//CoreVideo.framework/CoreVideo are out of sync. Falling back to library file for linking. ld: warning: text-based stu
See https://jenkins.wildfiregames.com/job/macos-differential/2711/display/redirect for more details.
I think this is a good idea in general, will make it easier in the future if somebody wants to mod per-dropside resources or something too.
binaries/data/mods/public/simulation/components/ResourceDropsite.js | ||
---|---|---|
45 ↗ | (On Diff #15045) | TakeResources maybe? In general the 'subject' is the resource dropsite, so 'add resources' doesn't seem very obvious. |
binaries/data/mods/public/simulation/components/ResourceGatherer.js | ||
314 ↗ | (On Diff #15045) | I'm wondering if you wouldn't have a neater interface if you returned the left-over resources directly. |
binaries/data/mods/public/simulation/components/ResourceDropsite.js | ||
---|---|---|
56 ↗ | (On Diff #15045) | You're right, I guess we don't really need to check for that. (I thought {} was falsy.) |
binaries/data/mods/public/simulation/components/ResourceGatherer.js | ||
311 ↗ | (On Diff #15045) | If one alters the receiver, yes of course. Just as changed could be greater than carrying which would be odd. |
314 ↗ | (On Diff #15045) | I was mostly following the routes in e.g. PerformGather, but also in other components (Health, Capturable): Return what has changed. |
Build is green
builderr-debug-macos.txt ld: warning: text-based stub file /System/Library/Frameworks//CoreAudio.framework/CoreAudio.tbd and library file /System/Library/Frameworks//CoreAudio.framework/CoreAudio are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox.tbd and library file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback.tbd and library file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback are out of sync. Falling back to library file for linking. ld: warning: text-based stub file /System/Library/Frameworks//CoreVideo.framework/CoreVideo.tbd and library file /System/Library/Frameworks//CoreVideo.framework/CoreVideo are out of sync. Falling back to library file for linking. ld: warning: text-based stu
See https://jenkins.wildfiregames.com/job/macos-differential/2739/display/redirect for more details.