start render other

This commit is contained in:
Tao Tien 2026-03-09 03:33:20 -07:00
parent 8f606543f5
commit 1b5b7c9e77
8 changed files with 193 additions and 80 deletions

View file

@ -72,6 +72,7 @@ pub struct Bot {
#[index(btree)]
pub lobby_id: u32,
#[unique]
pub config_id: u32,
}
@ -149,16 +150,21 @@ fn view_closed_hands(ctx: &ViewContext) -> Vec<HandView> {
.players
.iter()
.filter_map(|id| {
ctx.db
.player_hand()
.player_id()
.find(id)
.map(|hand| HandView {
player_id: hand.player_id,
hand_length: hand.hand.len() as u8,
pond: hand.pond,
drawn: hand.turn_state == TurnState::Tsumo && hand.working_tile.is_some(),
})
if *id == this_player.config_id {
None
} else {
ctx.db
.player_hand()
.player_id()
.find(id)
.map(|hand| HandView {
player_id: hand.player_id,
hand_length: hand.hand.len() as u8,
pond: hand.pond,
drawn: hand.turn_state == TurnState::Tsumo
&& hand.working_tile.is_some(),
})
}
})
.collect()
} else {