예제 #1
0
        /// <summary>
        /// 盤のクリック
        /// </summary>
        /// <param name="click_item"></param>
        public void ClickEvent(Square_ViewModel click_item)
        {
            _boardModel.move(new Reversi.Engine.Point(click_item.x, click_item.y));

            #region CPUの番だったらランダムに手を打つ
            if (_boardModel.CurrentColor == Reversi.Engine.Disc.WHITE)
            {
                //CPUの手番
                var cpu_p = _boardModel.RondomFlip();
                if (cpu_p == null)
                {
                    _boardModel.pass(); //パス
                }
                else
                {
                    _boardModel.move(cpu_p); //ランダムな手を打つ
                }
            }
            #endregion


            Reflesh();

            CheckGameOver();

        }
예제 #2
0
        /// <summary>
        /// 盤のクリック
        /// </summary>
        /// <param name="click_item"></param>
        public void ClickEvent(Square_ViewModel click_item)
        {
            _boardModel.move(new Reversi.Engine.Point(click_item.x, click_item.y));

            #region CPUの番だったらランダムに手を打つ
            if (_boardModel.CurrentColor == Reversi.Engine.Disc.WHITE)
            {
                //CPUの手番
                var cpu_p = _boardModel.RondomFlip();
                if (cpu_p == null)
                {
                    _boardModel.pass(); //パス
                }
                else
                {
                    _boardModel.move(cpu_p); //ランダムな手を打つ
                }
            }
            #endregion


            Reflesh();

            CheckGameOver();
        }
예제 #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();

        }