open_pql/functions/
scoops.rs

1use super::*;
2
3#[pqlfn]
4pub fn scoops(
5    pid: PQLPlayer,
6    (game, board, player_hands, ratings): (
7        PQLGame,
8        Board,
9        &PlayerHands,
10        &mut BufferRatings,
11    ),
12) -> PQLBoolean {
13    fill_ratings(PQLStreet::River, (game, board, player_hands, ratings));
14
15    let max = ratings.max();
16
17    if max != ratings[pid] {
18        return false;
19    }
20
21    !ratings
22        .iter()
23        .enumerate()
24        .any(|(i, r)| i != pid.to_usize() && *r == max)
25}