Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            Title = "HexSolver " + App.HS_VERSION + " (github.com/Mikescher/HexSolver)";

            CbxAutoSaveImgsave.IsEnabled = Directory.Exists(@"..\..\imgsave\");
            BtnCleanupImgsave.IsEnabled  = Directory.Exists(@"..\..\imgsave\");
            BtnSaveExample.IsEnabled     = Directory.Exists(@"..\..\example\");

            try
            {
                solver   = new HexcellsSolver(GetUIPatternParameters());
                renderer = new HexRenderer();

                int shotid = 1;
                for (; File.Exists(String.Format("./example/shot{0:000}.png", shotid)); shotid++)
                {
                }
                iudExample.Maximum = shotid - 1;
            }
            catch (Exception e)
            {
                MessageBox.Show(e.ToString(), "Execption while executing", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Ejemplo n.º 2
0
 public HexExecutor(HexcellsSolver svr, IHexExecutorFeedback fb)
 {
     Solver   = svr;
     feedback = fb ?? new DummyHexExecutorFeedback();
 }