private IEnumerable<IEnumerable<IField>> ToEnumerable(IField[,] array) { var count = array.GetLength(0); for (int i = 0; i < array.GetLength(0); ++i) { yield return GetLine(array, i); } }
private IEnumerable<IField> GetLine(IField[,] array, int line) { var count = array.GetLength(1); for (int i = 0; i < count; ++i) { yield return array[line, i]; } }
public void Reset() { Fields = new IField[Width, Height]; for (int i = 0; i < Fields.GetLength(0); i++) { for (int j = 0; j < Fields.GetLength(1); j++) { Fields[i, j] = FieldFactory.Create(i, j); } } }