// check whether draw was offered on previous turn
// return color that offered draw
check whether draw was offered on previous turn
return color that offered draw
check whether draw was offered on previous turn return color that offered draw
fn draw_offered(&self) -> Option<CwChessColor> {
        match &self.moves.last() {
            Some((_, CwChessAction::OfferDraw(_))) => {
                match self.turn_color() {
                    None => None,
                    // current turn means opposite color offered draw
                    Some(CwChessColor::Black) => Some(CwChessColor::White),
                    Some(CwChessColor::White) => Some(CwChessColor::Black),
                }
            }
            _ => None,
        }
    }
fn draw_offered ( & self ) -> Option < CwChessColor > { match & self . moves . last ( ) { Some ( ( _ , CwChessAction :: OfferDraw ( _ ) ) ) => { match self . turn_color ( ) { None => None , // current turn means opposite color offered draw Some ( CwChessColor :: Black ) => Some ( CwChessColor :: White ) , Some ( CwChessColor :: White ) => Some ( CwChessColor :: Black ) , } } _ => None , } }
check whether draw was offered on previous turn
return color that offered draw
check whether draw was offered on previous turn return color that offered draw
&self