这是违反得墨忒耳法则吗?
private void MoveEmptyCells()
{
IEnumerable<Cell> cells = this.internalGrid.GetAllEmptyCells();
foreach(Cell cell in cells)
{
cell.RowIndex += this.moveDistance; // violation here?
}
}
这个怎么样?
private void MoveEmptyCell()
{
Cell cell = this.internalGrid.GetEmptyCell();
cell.RowIndex += this.moveDistance; // violation here?
}