Could you not have a hashmap keyed on matches pointing to vectors of strings for the players in each match? Basically modeling the data how you want rather than relying on indexing.
this post was submitted on 25 Mar 2024
-1 points (0.0% liked)
Rust
6755 readers
18 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 2 years ago
MODERATORS
Not sure I understand. What I'm trying to do is something like this:
- Poll a stream which takes fedi events. Read player commands.
- If an event comes from a known player, check which match they are into.
- With that info, get their opponents/coplayers etc and perform the change of state in the game (send replies, next turn, etc).
So what I have as a key is a player name (AP username) and from that I need to find which match they're in.
There's nothing semantically useful about a match ID.