//********************************************************* // /// <summary> /// Default constructor /// </summary> /// <param name="frmFather"> Father form</param> // //********************************************************* private frmGameParameter(frmChessBoard frmFather) : this() { m_frmFather = frmFather; switch(m_frmFather.PlayingMode) { case frmChessBoard.PlayingModeE.DesignMode: throw new System.ApplicationException("Must not be called in design mode."); case frmChessBoard.PlayingModeE.PlayerAgainstComputer: radioButtonPlayerAgainstComputer.Checked = true; break; case frmChessBoard.PlayingModeE.PlayerAgainstPlayer: radioButtonPlayerAgainstPlayer.Checked = true; break; case frmChessBoard.PlayingModeE.ComputerAgainstComputer: radioButtonComputerAgainstComputer.Checked = true; break; } switch(m_frmFather.m_eComputerPlayingColor) { case ChessBoard.PlayerColorE.Black: radioButtonComputerPlayBlack.Checked = true; break; case ChessBoard.PlayerColorE.White: radioButtonComputerPlayWhite.Checked = true; break; } CheckState(); }
//********************************************************* // /// <summary> /// Ask for the game parameter /// </summary> /// <param name="frmFather"> Father form</param> /// <returns> /// true if succeed /// </returns> // //********************************************************* public static bool AskGameParameter(frmChessBoard frmFather) { bool bRetVal; frmGameParameter frm; frm = new frmGameParameter(frmFather); using(frm) { bRetVal = (frm.ShowDialog() == DialogResult.OK); } return(bRetVal); }