Exemple #1
0
 public void putPiece(Pieces p, Position pos)//put the piece in the board
 {
     if (existPiece(pos))
     {
         throw new BoardException("Theres a piece in this position");
     }
     PiecesBoard[pos.Row, pos.Column] = p;
     p.Position = pos;
 }
Exemple #2
0
        public Pieces removePiece(Position pos)
        {
            if (piece(pos) == null)
            {
                return(null);
            }
            Pieces aux = piece(pos);

            aux.Position = null;
            PiecesBoard[pos.Row, pos.Column] = null;
            return(aux);
        }