示例#1
0
        /// <include file='../GlobalDocComments.xml' path='comments/defaultConstructor'/>
        public SettingsWindow(Settings settings, ManualSolver manualSolver)
        {
            InitializeComponent();

            _manualSolver = manualSolver;
            Settings      = settings;

            InitializeSettingControls();
            InitializePriorityControls();
        }
示例#2
0
 /// <summary>
 /// To check if the puzzle is diamond or not.
 /// </summary>
 /// <param name="this">(<see langword="this"/> parameter) The puzzle to check.</param>
 /// <returns>A <see cref="bool"/> value indicating that.</returns>
 public static bool IsDiamond(this IReadOnlyGrid @this)
 {
     // Using a faster solver to check the grid is unique or not.
     if (@this.IsValid(out _))
     {
         var result = new ManualSolver().Solve(@this);
         var(er, pr, dr) = (result.MaxDifficulty, result.PearlDifficulty, result.DiamondDifficulty);
         return(er == pr && er == dr);
     }
     else
     {
         // The puzzle does not have unique solution, neither pearl nor diamond one.
         return(false);
     }
 }