protected void ExtendPolution(List <Cell> tCells) { List <Cell> newArray = new List <Cell>(); int nbCell = tCells.Count; for (int i = 0; i < nbCell; i++) { int nbICell = tCells[i].Neighbors.Count; for (int j = 0; j < nbICell; j++) { Cell neighbor = tCells[i].Neighbors[j]; if (!neighbor.Poluted && !newArray.Contains(neighbor) && !CELLS_USED.Contains(neighbor) && polutionStates.Contains(neighbor.State)) { newArray.Add(neighbor); _CELLS_USED.Add(neighbor); } } } if (newArray.Count > 0) { iteration++; cellIterator = 0; newArray = ObjectArray <Cell> .CheckIt(newArray); iterationCells.Add(newArray); Action(); } else { ForceExtend(); } }