Example #1
0
        public void BuildNew()
        {
            this.canvas = new Cell[rowsAmount, colsAmount];
            // build it
            generator.CreateBorder(canvas, rowsAmount, colsAmount, cellWidth, cellHeight);
            generator.CreateObstacles(canvas, rowsAmount, colsAmount, cellWidth, cellHeight);
            this.SetStart(generator.SetStart(rowsAmount - 1, colsAmount - 1));
            this.SetEnd(generator.SetEnd(rowsAmount - 1, colsAmount - 1));

            // sign up for the event
            foreach (Cell cell in canvas)
            {
                cell.TypeChanged += (obj, args) => OnCellColorChanged(args);
            }
        }