fn guess_floor(&self, cd: Coord) -> Option<Surface> {
        let (mut cnt_f, mut cnt_r) = (0, 0);
        for d in Direc::vars().take(8) {
            if let Some(cell) = self.get(cd + d.to_cd()) {
                match cell.surface {
                    Surface::Road => cnt_r += 1,
                    Surface::Floor => cnt_f += 1,
                    _ => {}
                }
            }
        }
        // 雑すぎかも？
        if cnt_f >= cnt_r {
            Some(Surface::Floor)
        } else {
            Some(Surface::Road)
        }
    }
// check need_guess before call this fn
check need_guess before call this fn
check need_guess before call this fn
fn guess_floor(&self, cd: Coord) -> Option<Surface> {
        let (mut cnt_f, mut cnt_r) = (0, 0);
        for d in Direc::vars().take(8) {
            if let Some(cell) = self.get(cd + d.to_cd()) {
                match cell.surface {
                    Surface::Road => cnt_r += 1,
                    Surface::Floor => cnt_f += 1,
                    _ => {}
                }
            }
        }
        // 雑すぎかも？
        if cnt_f >= cnt_r {
            Some(Surface::Floor)
        } else {
            Some(Surface::Road)
        }
    }
fn guess_floor ( & self , cd : Coord ) -> Option < Surface > { let ( mut cnt_f , mut cnt_r ) = ( 0 , 0 ) ; for d in Direc :: vars ( ) . take ( 8 ) { if let Some ( cell ) = self . get ( cd + d . to_cd ( ) ) { match cell . surface { Surface :: Road => cnt_r += 1 , Surface :: Floor => cnt_f += 1 , _ => { } } } } // 雑すぎかも？ if cnt_f >= cnt_r { Some ( Surface :: Floor ) } else { Some ( Surface :: Road ) } }
check need_guess before call this fn
check need_guess before call this fn
&self
cd
Coord
&self
cd
Coord