fn layout(&mut self) {
        if let Some(ref mut board) = self.board {
            if let Some(ref mut info) = self.info {
                let (b_w, b_h) = (board.get_width(), board.get_height());
                let (mut i_w, mut i_h) = (board.get_width(), board.get_height());
                let i_size = info.get_size();
                let (b_x, b_y, i_x, i_y) = match info.get_layout() {
                    InfoLayout::Left => {
                        i_w = i_size;
                        (i_w + 1, SCREEN_TOP, SCREEN_LEFT, SCREEN_TOP)
                    }
                    InfoLayout::Right => {
                        i_w = i_size;
                        (SCREEN_LEFT, SCREEN_TOP, b_w + 1, SCREEN_TOP)
                    }
                    InfoLayout::Top => {
                        i_h = i_size;
                        (SCREEN_LEFT, i_h + 1, SCREEN_LEFT, SCREEN_TOP)
                    }
                    InfoLayout::Bottom => {
                        i_h = i_size;
                        (SCREEN_LEFT, SCREEN_TOP, SCREEN_LEFT, b_h + 1)
                    }
                };
                board.set_position(Position(b_x, b_y));
                info.set_position_and_size(Position(i_x, i_y), i_w, i_h);
            } else {
                board.set_position(Position(SCREEN_LEFT, SCREEN_TOP));
            };
        }
    }
// Layout board and information area on the screen.
Layout board and information area on the screen.
Layout board and information area on the screen .
fn layout(&mut self) {
        if let Some(ref mut board) = self.board {
            if let Some(ref mut info) = self.info {
                let (b_w, b_h) = (board.get_width(), board.get_height());
                let (mut i_w, mut i_h) = (board.get_width(), board.get_height());
                let i_size = info.get_size();
                let (b_x, b_y, i_x, i_y) = match info.get_layout() {
                    InfoLayout::Left => {
                        i_w = i_size;
                        (i_w + 1, SCREEN_TOP, SCREEN_LEFT, SCREEN_TOP)
                    }
                    InfoLayout::Right => {
                        i_w = i_size;
                        (SCREEN_LEFT, SCREEN_TOP, b_w + 1, SCREEN_TOP)
                    }
                    InfoLayout::Top => {
                        i_h = i_size;
                        (SCREEN_LEFT, i_h + 1, SCREEN_LEFT, SCREEN_TOP)
                    }
                    InfoLayout::Bottom => {
                        i_h = i_size;
                        (SCREEN_LEFT, SCREEN_TOP, SCREEN_LEFT, b_h + 1)
                    }
                };
                board.set_position(Position(b_x, b_y));
                info.set_position_and_size(Position(i_x, i_y), i_w, i_h);
            } else {
                board.set_position(Position(SCREEN_LEFT, SCREEN_TOP));
            };
        }
    }
fn layout ( & mut self ) { if let Some ( ref mut board ) = self . board { if let Some ( ref mut info ) = self . info { let ( b_w , b_h ) = ( board . get_width ( ) , board . get_height ( ) ) ; let ( mut i_w , mut i_h ) = ( board . get_width ( ) , board . get_height ( ) ) ; let i_size = info . get_size ( ) ; let ( b_x , b_y , i_x , i_y ) = match info . get_layout ( ) { InfoLayout :: Left => { i_w = i_size ; ( i_w + 1 , SCREEN_TOP , SCREEN_LEFT , SCREEN_TOP ) } InfoLayout :: Right => { i_w = i_size ; ( SCREEN_LEFT , SCREEN_TOP , b_w + 1 , SCREEN_TOP ) } InfoLayout :: Top => { i_h = i_size ; ( SCREEN_LEFT , i_h + 1 , SCREEN_LEFT , SCREEN_TOP ) } InfoLayout :: Bottom => { i_h = i_size ; ( SCREEN_LEFT , SCREEN_TOP , SCREEN_LEFT , b_h + 1 ) } } ; board . set_position ( Position ( b_x , b_y ) ) ; info . set_position_and_size ( Position ( i_x , i_y ) , i_w , i_h ) ; } else { board . set_position ( Position ( SCREEN_LEFT , SCREEN_TOP ) ) ; } ; } }
Layout board and information area on the screen.
Layout board and information area on the screen .
&mut self
&mut self