Пример #1
0
 public void AddFigure(IFigure figure)
 {
     //todo:color
     ObjectValidator.CheckForNullObject(figure, ExceptionMessages.NullFigureErrorMesage);
     CheckIfFigureExists(figure);
     this.figures.Add(figure);
 }
Пример #2
0
        public void AddFigure(IFigure figure, Position position)
        {
            ObjectValidator.CheckForNullObject(figure, ExceptionMessages.NullFigureErrorMesage);
            ValidatePosition(position);
            int arrayRow = GetArrayRow(position.Row);
            int arrayCol = GetArrayCol(position.Col);

            this.board[arrayRow, arrayCol] = figure;
        }
Пример #3
0
 public void RemoveFigure(IFigure figure)
 {//todo:color
     ObjectValidator.CheckForNullObject(figure, ExceptionMessages.NullFigureErrorMesage);
     CheckIfFigureDoesNotExist(figure);
     this.figures.Remove(figure);
 }