You could store the matches in a HashMap as well, using some MatchId type as the key, i.e., HashMap<MatchId, Match>. Then you can use that as the reference in players: HashMap<String, MatchID>. Only downside is that you have to generate unique MatchIds, e.g., by using some counter.
You could store the matches in a
HashMap
as well, using someMatchId
type as the key, i.e.,HashMap<MatchId, Match>
. Then you can use that as the reference inplayers: HashMap<String, MatchID>
. Only downside is that you have to generate uniqueMatchId
s, e.g., by using some counter.