this post was submitted on 25 Mar 2024
8 points (100.0% liked)
Rust
5938 readers
2 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
If you instead made your
lobby
field aHashMap<String, MatchId>
, then whenever you get an event from a known player, you can lookup the match they are in from the lobby map and use that to lookup other data about the match (such as the other players) via thematches
field (assuming that was also changed to be a hashmap as described in my previous comment).