2 ms·
I'd look at the "systems" idea from ECS design. See for example bevy https://bevy-cheatbook.github.io/patterns/generic-systems.html https://bevy-cheatbook.githu
by viraptor 4y ago
I'd look at the "systems" idea from ECS design. See for example bevy https://bevy-cheatbook.github.io/patterns/generic-systems.html https://bevy-cheatbook.github.io/patterns/generic-systems.ht... which will also satisfy RiiR for the sibling comment ; )
The main idea is to have a callback and iteration over entities you have (that match some condition/interface). This would refactor the code to .add_system(reduce_size).add_system(handle_magnet_carrier).add_system(...)..., where each section is a separate behaviour which can be tested in isolation.