Problem with HashMaps and Resources #6818
-
I'm working on a Minecraft-like chunk system where chunks load and unload around the player. I have a hash map resource that uses a position as a key and the chunk entity as the value. I'm not experienced with bevy or rust so I'm not sure why but, when I try to iterate over the dictionary and remove items, I get errors. Help please. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
Beta Was this translation helpful? Give feedback.
Hash
requiresEq
to be implemented on the type.Vec2
does not implement it sincef32
does not implement it sinceNaN
exists and breaks the contract ofEq
. If you're doing a chunk map, you could useUVec2
, which uses integers instead of f32, and it implements bothEq
andHash
.