public bool ShouldChangeState(TileDay24 tile) { if (tile.Neighbours == 2 && !tile.State) { return(true); } else if ((tile.Neighbours == 0 || tile.Neighbours > 2) && tile.State) { return(true); } return(false); }
public HexFloorTileDay24(int size, IInstructionService instructionService, INeighboourStrategy strategy) { _tiles = new TileDay24[size * 2 + 1, (size * 2 + 1) * 2]; for (int i = 0; i < _tiles.GetLength(0); i++) { for (int j = 0; j < _tiles.GetLength(1); j++) { _tiles[i, j] = new TileDay24(); } } _instructionService = instructionService; _strategy = strategy; _heightCenter = size + 1; _widthCenter = size * 2 + 1; }