pub fn add_tip_to_local_tips(&mut self, tip: Tip) {
        let game_key = GAME_SELECTED.read().unwrap().get_game_key_name();

        // First, delete any tip with the same id, so in case of editing, we "overwrite" the old one instead of creating a new one.
        self.delete_tip_by_id(*tip.get_ref_id());

        // Then, add the new tip.
        match self.local_tips.tips.get_mut(&game_key) {
            Some(game_tips) => match game_tips.get_mut(tip.get_ref_path()) {
                Some(tips) => tips.push(tip),
                None => { game_tips.insert(tip.get_ref_path().to_owned(), vec![tip]); }
            }
            None => {
                let mut game_tips = HashMap::new();
                game_tips.insert(tip.get_ref_path().to_owned(), vec![tip]);
                self.local_tips.tips.insert(game_key, game_tips);
            }
        }
    }
/// This function adds a tip to the local tips.
This function adds a tip to the local tips.
This function adds a tip to the local tips .
pub fn add_tip_to_local_tips(&mut self, tip: Tip) {
        let game_key = GAME_SELECTED.read().unwrap().get_game_key_name();
        // First, delete any tip with the same id, so in case of editing, we "overwrite" the old one instead of creating a new one.
        self.delete_tip_by_id(*tip.get_ref_id());
        // Then, add the new tip.
        match self.local_tips.tips.get_mut(&game_key) {
            Some(game_tips) => match game_tips.get_mut(tip.get_ref_path()) {
                Some(tips) => tips.push(tip),
                None => { game_tips.insert(tip.get_ref_path().to_owned(), vec![tip]); }
            }
            None => {
                let mut game_tips = HashMap::new();
                game_tips.insert(tip.get_ref_path().to_owned(), vec![tip]);
                self.local_tips.tips.insert(game_key, game_tips);
            }
        }
    }
pub fn add_tip_to_local_tips ( & mut self , tip : Tip ) { let game_key = GAME_SELECTED . read ( ) . unwrap ( ) . get_game_key_name ( ) ; // First, delete any tip with the same id, so in case of editing, we "overwrite" the old one instead of creating a new one. self . delete_tip_by_id ( * tip . get_ref_id ( ) ) ; // Then, add the new tip. match self . local_tips . tips . get_mut ( & game_key ) { Some ( game_tips ) => match game_tips . get_mut ( tip . get_ref_path ( ) ) { Some ( tips ) => tips . push ( tip ) , None => { game_tips . insert ( tip . get_ref_path ( ) . to_owned ( ) , vec ! [ tip ] ) ; } } None => { let mut game_tips = HashMap :: new ( ) ; game_tips . insert ( tip . get_ref_path ( ) . to_owned ( ) , vec ! [ tip ] ) ; self . local_tips . tips . insert ( game_key , game_tips ) ; } } }
This function adds a tip to the local tips.
This function adds a tip to the local tips .
&mut self
tip
Tip
&mut self
tip
Tip