Is this a violation of the Law of Demeter?
private void MoveEmptyCells()
{
IEnumerable<Cell> cells = this.internalGrid.GetAllEmptyCells();
foreach(Cell cell in cells)
{
cell.RowIndex += this.moveDistance; // violation here?
}
}
How about this one?
private void MoveEmptyCell()
{
Cell cell = this.internalGrid.GetEmptyCell();
cell.RowIndex += this.moveDistance; // violation here?
}