Function poke_a_mango::ops::state::end_mango [] [src]

pub fn end_mango(s: &mut GameState, clicked: bool, was_mango: bool)

End the mango processing sequence, given whether it was clicked and whether it was actually a mango.

If the supplied argument is not Playing or the button wasn't clicked, it remains unchanged.

Examples

let mut state = GameState::Playing {
    difficulty: Difficulty::Hard,
    score: 12,
    fruit: None,
};
state::end_mango(&mut state, mango_button_clicked, previous_fruit.is_none());