public int GetNeighbors(Cell c) { int nl = 0; for (int x = -1; x <= 1; x++) { for (int y = -1; y <= 1; y++) { if (c.Equals(new Cell(c.X + x, c.Y + y)) == false) { if (isCell(c.X + x, c.Y + y)) { nl++; } } } } return(nl); }
public bool EqualsReturnsTrueWhenCoordinatesAreEqual(LifeStates lifeA, int aX, int aY, LifeStates lifeB, int bX, int bY) { Cell cellA = new Cell(lifeA, aX, aY); Cell block4 = new Cell(lifeB, bX, bY); return cellA.Equals(block4); }