fn update(&mut self, width: usize, height: usize, anim_counter: usize) {
        // let start = self.get_time();
        if self.context.is_debugging == true {
            self.context.data.tick(Some((width, height - self.context.toolbar_height / 2, anim_counter)));
            self.content[self.state as usize].1.as_mut().unwrap().update(&mut self.context);
        } else
        if self.context.is_running {
            self.context.data.tick(Some((width, height - self.context.toolbar_height / 2, anim_counter)));
        }
        // let stop = self.get_time();
        // println!("update time {:?}", stop - start);

        // When stopped, update the graph
        if self.context.just_stopped_running {
            self.content[self.state as usize].1.as_mut().unwrap().update(&mut self.context);
            self.context.just_stopped_running = false;
        }
    }
/// Game tick if the game is running
Game tick if the game is running
Game tick if the game is running
fn update(&mut self, width: usize, height: usize, anim_counter: usize) {
        // let start = self.get_time();
        if self.context.is_debugging == true {
            self.context.data.tick(Some((width, height - self.context.toolbar_height / 2, anim_counter)));
            self.content[self.state as usize].1.as_mut().unwrap().update(&mut self.context);
        } else
        if self.context.is_running {
            self.context.data.tick(Some((width, height - self.context.toolbar_height / 2, anim_counter)));
        }
        // let stop = self.get_time();
        // println!("update time {:?}", stop - start);
        // When stopped, update the graph
        if self.context.just_stopped_running {
            self.content[self.state as usize].1.as_mut().unwrap().update(&mut self.context);
            self.context.just_stopped_running = false;
        }
    }
fn update ( & mut self , width : usize , height : usize , anim_counter : usize ) { // let start = self.get_time(); if self . context . is_debugging == true { self . context . data . tick ( Some ( ( width , height - self . context . toolbar_height / 2 , anim_counter ) ) ) ; self . content [ self . state as usize ] . 1 . as_mut ( ) . unwrap ( ) . update ( & mut self . context ) ; } else if self . context . is_running { self . context . data . tick ( Some ( ( width , height - self . context . toolbar_height / 2 , anim_counter ) ) ) ; } // let stop = self.get_time(); // println!("update time {:?}", stop - start); // When stopped, update the graph if self . context . just_stopped_running { self . content [ self . state as usize ] . 1 . as_mut ( ) . unwrap ( ) . update ( & mut self . context ) ; self . context . just_stopped_running = false ; } }
Game tick if the game is running
Game tick if the game is running
&mut self
width
usize
height
usize
anim_counter
usize
&mut self
width
usize
height
usize
anim_counter
usize