Пример #1
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public MainWindow_ViewModel()
        {
            _boardModel     = new Reversi.Engine.Board();
            Board_ViewModel = new Board_ViewModel(_boardModel);

            undoCMD  = new DelegateCommand(() => Undo());
            passCMD  = new DelegateCommand(() => Pass());
            startCMD = new DelegateCommand(() => Start());
        }
Пример #2
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public MainWindow_ViewModel()
        {
            _boardModel = new Reversi.Engine.Board();
            Board_ViewModel = new Board_ViewModel(_boardModel);

            undoCMD = new DelegateCommand(() =>Undo());
            passCMD = new DelegateCommand(() => Pass());
            startCMD = new DelegateCommand(() => Start());
        }
Пример #3
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public Board_ViewModel(Reversi.Engine.Board boardModel)
        {
            _boardModel = boardModel;

            SquareList = new ObservableCollection <Square_ViewModel>();

            for (int x = 1; x <= Reversi.Engine.Reversi.BOARD_SIZE; x++)
            {
                for (int y = 1; y <= Reversi.Engine.Reversi.BOARD_SIZE; y++)
                {
                    int color = _boardModel.getColor(x, y);
                    var item  = new Square_ViewModel();
                    item.x = x; item.y = y;
                    SquareList.Add(item);
                }
            }

            Reflesh();
        }
Пример #4
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        public Board_ViewModel(Reversi.Engine.Board boardModel)
        {
            _boardModel = boardModel;

            SquareList = new ObservableCollection<Square_ViewModel>();

            for (int x = 1; x <= Reversi.Engine.Reversi.BOARD_SIZE ; x++)
            {
                for (int y = 1; y <= Reversi.Engine.Reversi.BOARD_SIZE ; y++)
                {
                    int color = _boardModel.getColor(x, y);
                    var item = new Square_ViewModel();
                    item.x = x; item.y = y;
                    SquareList.Add(item);
                }
            }

            Reflesh();

        }