andriyDev / landmass

A navigation system for video games written in Rust.
Apache License 2.0
14 stars 1 forks source link

Refactor `AgentId`, `IslandId`, and `BoundaryLinkId` into truly unique IDs. #38

Closed andriyDev closed 3 weeks ago

andriyDev commented 3 weeks ago

Previously, we just randomly generated a number and panicked if the ID was already in a set. Now, we are using slotmap to have truly unique IDs. We've in fact completely removed the dependency on rand!

codecov-commenter commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 99.27007% with 3 lines in your changes missing coverage. Please review.

Project coverage is 98.3%. Comparing base (1540180) to head (7b396a3).

Additional details and impacted files | [Files](https://app.codecov.io/gh/andriyDev/landmass/pull/38?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | Coverage Δ | | |---|---|---| | [src/agent.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/38?src=pr&el=tree&filepath=src%2Fagent.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2FnZW50LnJz) | `100.0% <ø> (ø)` | | | [src/avoidance.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/38?src=pr&el=tree&filepath=src%2Favoidance.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2F2b2lkYW5jZS5ycw==) | `95.8% <100.0%> (+<0.1%)` | :arrow_up: | | [src/avoidance\_test.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/38?src=pr&el=tree&filepath=src%2Favoidance_test.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2F2b2lkYW5jZV90ZXN0LnJz) | `99.2% <100.0%> (-0.1%)` | :arrow_down: | | [src/debug.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/38?src=pr&el=tree&filepath=src%2Fdebug.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2RlYnVnLnJz) | `98.5% <100.0%> (ø)` | | | [src/island.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/38?src=pr&el=tree&filepath=src%2Fisland.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2lzbGFuZC5ycw==) | `65.5% <ø> (ø)` | | | [src/lib.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/38?src=pr&el=tree&filepath=src%2Flib.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2xpYi5ycw==) | `90.8% <100.0%> (-0.6%)` | :arrow_down: | | [src/lib\_test.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/38?src=pr&el=tree&filepath=src%2Flib_test.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL2xpYl90ZXN0LnJz) | `100.0% <100.0%> (ø)` | | | [src/nav\_data.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/38?src=pr&el=tree&filepath=src%2Fnav_data.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL25hdl9kYXRhLnJz) | `99.4% <100.0%> (+<0.1%)` | :arrow_up: | | [src/nav\_data\_test.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/38?src=pr&el=tree&filepath=src%2Fnav_data_test.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL25hdl9kYXRhX3Rlc3QucnM=) | `99.5% <100.0%> (+<0.1%)` | :arrow_up: | | [src/path\_test.rs](https://app.codecov.io/gh/andriyDev/landmass/pull/38?src=pr&el=tree&filepath=src%2Fpath_test.rs&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None#diff-c3JjL3BhdGhfdGVzdC5ycw==) | `100.0% <100.0%> (ø)` | | | ... and [5 more](https://app.codecov.io/gh/andriyDev/landmass/pull/38?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) | |