public BookOptions(BookOptionsType type, string xml)
        {
            this.OptionsType = type;

            if (!String.IsNullOrEmpty(xml))
            {
                LoadXml(xml);
            }
        }
Beispiel #2
0
        private void FillBookData(BookOptionsType type)
        {
            switch (type)
            {
            case BookOptionsType.Global:
                chkUseBook.Checked        = bookOptions.UseBook;
                chkTournamentBook.Checked = bookOptions.TournamentBook;
                numericMinimumGame.Value  = bookOptions.MinGames;
                numericUpToMove.Value     = bookOptions.MaxMoves;
                break;

            case BookOptionsType.WhiteEngine:
                chkUseBook.Checked        = bookOptions.WhiteUseBook;
                chkTournamentBook.Checked = bookOptions.WhiteTournamentBook;
                numericMinimumGame.Value  = bookOptions.WhiteMinGames;
                numericUpToMove.Value     = bookOptions.WhiteMaxMoves;
                break;

            case BookOptionsType.BlackEngine:
                chkUseBook.Checked        = bookOptions.BlackUseBook;
                chkTournamentBook.Checked = bookOptions.BlackTournamentBook;
                numericMinimumGame.Value  = bookOptions.BlackMinGames;
                numericUpToMove.Value     = bookOptions.BlackMaxMoves;
                break;

            case BookOptionsType.Optimize:
                chkUseBook.Checked        = bookOptions.OptimizeUseBook;
                chkTournamentBook.Checked = bookOptions.OptimizeTournamentBook;
                numericMinimumGame.Value  = bookOptions.OptimizeMinGames;
                numericUpToMove.Value     = bookOptions.OptimizeMaxMoves;
                break;

            case BookOptionsType.Normal:
                chkUseBook.Checked        = bookOptions.NormalUseBook;
                chkTournamentBook.Checked = bookOptions.NormalTournamentBook;
                numericMinimumGame.Value  = bookOptions.NormalMinGames;
                numericUpToMove.Value     = bookOptions.NormalMaxMoves;
                break;

            case BookOptionsType.Handicap:
                chkUseBook.Checked        = bookOptions.HandicapUseBook;
                chkTournamentBook.Checked = bookOptions.HandicapTournamentBook;
                numericMinimumGame.Value  = bookOptions.HandicapMinGames;
                numericUpToMove.Value     = bookOptions.HandicapMaxMoves;
                break;

            default:
                break;
            }
        }
 public BookOptions(BookOptionsType type)
 {
     this.OptionsType = type;
     Load();
 }
 public BookOptions()
 {
     this.OptionsType = BookOptionsType.Global;
     Load();
 }