Exemplo n.º 1
0
        public Logic()
        {
            // todo init all cells. some of the cell shall include a piece
            for (int i = 0; i < this.castlingHasMoved.Length; i++)
            {
                castlingHasMoved[i] = false;
            }

            for (int i = 0; i < ep.Length; i++)
            {
                ep[i] = new EnPassant();
            }

            InitGrid();
        }
Exemplo n.º 2
0
        public bool EnPassantRight(Cell cell)
        {
            EnPassant epTemp = new EnPassant();

            epTemp.SetCell(grid[cell.I, cell.J + 1]);
            epTemp.SetIsActive(true);
            if (grid[cell.I, cell.J + 1].piece != null)
            {
                for (int i = 0; i < ep.Length; i++)
                {
                    if (ep[i].GetCell() == epTemp.GetCell())
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }