示例#1
0
        public int GetHorizontalWinO(object sender, MyPosEventArgs args)
        {
            int win = 0;

            for (int i = 0; i < _cells.GetLength(0); i++)
            {
                if (_cells[i, args.Y] is OCell)
                {
                    win = 1;
                }
                else
                {
                    win = 0;
                    break;
                }
            }
            _horzWinO = win;
            return(win);
        }
示例#2
0
        public int GetVerticalWinO(object sender, MyPosEventArgs args)
        {
            int win = 0;

            for (int i = 0; i < _cells.GetLength(0); i++)
            {
                if (_cells[args.X, i] is OCell)
                {
                    win = 1;
                }
                else
                {
                    win = 0;
                    break;
                }
            }
            _vertWinO = win;
            return(win);
        }