Пример #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;
        }
Пример #2
0
 public void RemoveFigure(IFigure figure)
 {
     ObjectValidator.CheckIfObjectIsValid(figure, NullFigureMessage);
     this.CheckIfFigureDoesntExists(figure);
     this.figures.Remove(figure);
 }
Пример #3
0
 public void AddFigure(IFigure figure)
 {
     ObjectValidator.CheckIfObjectIsValid(figure, NullFigureMessage);
     this.CheckIfFigureExists(figure);
     this.figures.Add(figure);
 }