private void SpawnNewCells(Cell liveCell) { var neighbors = new List <Cell>(); var xLocation = liveCell.XLocation; var yLocation = liveCell.YLocation; liveCell.Neighbors().ToList().ForEach(BirthNewCell); }
private int CountAliveNeighbors(Cell cell) { var count = 0; foreach (var neighbor in cell.Neighbors()) { if (_currentLiveGen.ContainsKey(neighbor.ToString())) { count++; } } return(count); }
public bool NeighborsReturnsTrueWhenCellsAreNextToEachOther(int aX, int aY, int bX, int bY) { Cell cellA = new Cell(LifeStates.ALIVE, aX, aY); Cell cellB = new Cell(LifeStates.ALIVE, bX, bY); return cellA.Neighbors(cellB); }