void RestoreDefaults()
        {
            if (_backupMatrix == null)
            {
                _backupMatrix = new LabyrinthMatrixViewModel(MatrixVM);
            }
            else
            {
                MatrixVM = new LabyrinthMatrixViewModel(_backupMatrix);
            }

            CurrentGeneration = 0;
        }
        public MainViewModel(ILabyrinthMatrixProvider provider
                             , IMatrixDataProvider matrixDataProvider
                             , ILabyrinthPathFindingStrategy strategy)
        {
            StartCommand = new RelayCommand(OnStart, () => !IsExecuting);

            string matrix = matrixDataProvider.GetMatrixString(new Uri("pack://application:,,,/Resources/LabyrinthMatrix.txt"));


            MatrixVM = new LabyrinthMatrixViewModel(provider.GetLabyrinthMatrixFromString(matrix));

            _strategy = strategy;
        }
Пример #3
0
 public LabyrinthMatrixViewModel(LabyrinthMatrixViewModel vm)
 {
     _labyrinthMatrix = new LabyrinthMatrix(vm._labyrinthMatrix);
 }