예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            // TODO: Разобраться с файлом настроек и не городить такие безобразные строчки
            GlobalSettings.EightWay = Properties.Settings.Default.EightWay;

            // Data
            _searchingAlg = new DijkstraSearch();
            _nodeGrid     = SquareGrid.CreateWithForest();
            _start        = _nodeGrid[3, 3];
            _start.Type   = NodeType.Start;
            _goal         = _nodeGrid[8, 7];
            _goal.Type    = NodeType.Goal;
            _nodeGrid.AddWall(8, 1);
            _history = _history = _searchingAlg.SearchWithHistory(_nodeGrid, _start, _goal);

            // View
            GridView.Init(_history);
            GridView.ShowStep(-1);

            GridView.WallAdded    += GridView_WallAdded;
            GridView.WallRemoved  += GridView_WallRemoved;
            GridView.StartChanged += GridView_StartChanged;
            GridView.GoalChanged  += GridView_GoalChanged;
        }