|
|
|
|
|
by codetrotter
2642 days ago
|
|
> To "get around" this (but see the next paragraph), we usually associate each node to a simple identifier such as an integer (usize), and store all nodes into a Vec. [...] > Honestly, I think this is good practice even outside of Rust. It is, and they use this way of writing their code a lot in game dev. They call it Entity Component System, or ECS for short. The concept of ECS extends a bit beyond what you described above but fundamentally I perceive your description to fall in line with ECS. https://en.wikipedia.org/wiki/Entity_component_system An ECS library for Rust exists, named Specs. It might be of interest. https://slide-rs.github.io/specs/ |
|