Ejemplo n.º 1
0
        public void ClickOnColumn(int columnNumber)
        {
            if (_selectedTile == null)
            {
                _selectedTile = SelectTile(SideNow);
                UpTileToStartPosition(_selectedTile, columnNumber);
                _selectedColumn = columnNumber;
            }
            else if (_selectedColumn != columnNumber)
            {
                UpTileToStartPosition(_selectedTile, columnNumber);
                _selectedColumn = columnNumber;
            }
            else if (!_board.CheckColumnIsFull(columnNumber))
            {
                _selectedTile.MoveTo(_board.SelectEmptyCell(columnNumber, _selectedTile));
                RemoveTileFromSideTiles(_selectedTile);
                _selectedColumn = 0;

                if (SideNow == Fill.Iks)
                {
                    SideNow = Fill.Zero;
                }
                else
                {
                    SideNow = Fill.Iks;
                }

                _selectedTile = null;
            }

            //AI
            if (SideNow == Fill.Zero)
            {
                if (_AI.enabled)
                {
                    _AI.Do();
                }
            }
        }