pub fn bomb_check(
        board: &mut [[Option<Card>; 5]; 4],
        position: Position,
        bombs: &mut [[u8; 5]; 4],
    ) {
        let cell = &mut bombs[position.0][position.1];
        // check if there is a bomb
        if *cell > 0 {
            match &mut board[position.0][position.1] {
                Some(card) => {
                    // bombs detonate reducing every stat down to a minimum of 1
                    card.downgrade(*cell);
                    // all bombs are detonated
                    *cell = 0;
                }
                None => {}
            }
        }
    }
// checks for bombs and applies damage accordingly
checks for bombs and applies damage accordingly
checks for bombs and applies damage accordingly
pub fn bomb_check(
        board: &mut [[Option<Card>; 5]; 4],
        position: Position,
        bombs: &mut [[u8; 5]; 4],
    ) {
        let cell = &mut bombs[position.0][position.1];
        // check if there is a bomb
        if *cell > 0 {
            match &mut board[position.0][position.1] {
                Some(card) => {
                    // bombs detonate reducing every stat down to a minimum of 1
                    card.downgrade(*cell);
                    // all bombs are detonated
                    *cell = 0;
                }
                None => {}
            }
        }
    }
pub fn bomb_check ( board : & mut [ [ Option < Card > ; 5 ] ; 4 ] , position : Position , bombs : & mut [ [ u8 ; 5 ] ; 4 ] , ) { let cell = & mut bombs [ position . 0 ] [ position . 1 ] ; // check if there is a bomb if * cell > 0 { match & mut board [ position . 0 ] [ position . 1 ] { Some ( card ) => { // bombs detonate reducing every stat down to a minimum of 1 card . downgrade ( * cell ) ; // all bombs are detonated * cell = 0 ; } None => { } } } }
checks for bombs and applies damage accordingly
checks for bombs and applies damage accordingly
board
&mut [[Option<Card>; 5]; 4]
position
Position
bombs
&mut [[u8; 5]; 4]