Ejemplo n.º 1
0
        public void AddFigure(IFigure figure, Position position)
        {
            ObjectValidator.CheckIfObjectIsValid(figure, NullFigureMessage);
            ObjectValidator.CheckIfPositionIsValid(position, InvalidPositionMessage);
            int arrRow = position.Row;
            int arrCol = position.Col;

            this.chessboard[arrRow, arrCol] = figure;
        }
Ejemplo n.º 2
0
        public IFigure RemoveFigure(Position position)
        {
            ObjectValidator.CheckIfPositionIsValid(position, InvalidPositionMessage);

            int arrRow = position.Row;
            int arrCol = position.Col;
            var figure = this.chessboard[arrRow, arrCol];

            this.chessboard[arrRow, arrCol] = null;
            return(figure);
        }