bot
This commit is contained in:
parent
80d4c256c0
commit
24ddcce233
10 changed files with 188 additions and 10 deletions
|
|
@ -165,6 +165,14 @@ impl GameState {
|
|||
.next()
|
||||
}
|
||||
|
||||
pub fn player_color_by_id(&self, player_id: &PlayerId) -> Option<Color> {
|
||||
self.players
|
||||
.iter()
|
||||
.filter(|(id, _)| *id == player_id)
|
||||
.map(|(_, player)| player.color)
|
||||
.next()
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
// Rules checks
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue