cell_width() and padding() were functions that didn't accept any arguments. As a result, they could only return hard-coded values (or lookup values in a global dictionary, which would be awkward). This commit removes both cell_width() and padding() functions from the HbProfile trait, and adds them as arguments to collider::Collider::new(). This allows you to create/destroy Collider instances on the fly, which can be useful in certain types of simulators.
WARNING I also accidentally committed changes I made to the tests in src/core/dur_hitbox/mod.rs. Please check that I didn't change the tests before accepting this commit (all tests passed with my changes).
This change seems fine to me. The dir_hitbox tests that you changed seemed to be incorrectly using equality tests instead of assignment operators, so your changes to that are appropriate.
cell_width()
andpadding()
were functions that didn't accept any arguments. As a result, they could only return hard-coded values (or lookup values in a global dictionary, which would be awkward). This commit removes both cell_width() and padding() functions from the HbProfile trait, and adds them as arguments to collider::Collider::new(). This allows you to create/destroy Collider instances on the fly, which can be useful in certain types of simulators.WARNING I also accidentally committed changes I made to the tests in
src/core/dur_hitbox/mod.rs
. Please check that I didn't change the tests before accepting this commit (all tests passed with my changes).