Exemple #1
0
        private void CreateNewBoard(int rowCount, int colCount)
        {
            StopAutoplay();

            if (mVisualModel != null)
            {
                mVisualModel.Reset();
                mVisualModel.CellLeftMouseDown -= VisualModel_CellLeftMouseDown;
            }

            mModel       = new BoardModel(rowCount, colCount, Stepper);
            mVisualModel = new VisualBoardModel(grdBoard, mModel);
            mVisualModel.CellLeftMouseDown += VisualModel_CellLeftMouseDown;
        }
Exemple #2
0
        public VisualBoardModel(Grid layout, BoardModel model)
        {
            Layout   = layout;
            RowCount = model.RowCount;
            ColCount = model.ColCount;
            Model    = model;

            ElemVisibleFill.Freeze();
            ElemHiddenFill.Freeze();
            ElemTransform.Freeze();

            Elements = new Shape[model.RowCount, model.ColCount];

            CreateLayout();
            CreateCells();

            Model.ModelChanged += Model_ModelChanged;
        }