/// <summary> /// Gets whether the given cell is considered 'alive'. /// </summary> /// <param name="x">The position of the cell on the x-axis.</param> /// <param name="y">The position of the cell on the y-axis.</param> /// <param name="gameField">The IGameField to pull the data from.</param> /// <returns> /// Returns 0 if the index is out of valid range or the cell is 'dead'; /// returns 1 if the cell is 'alive'. /// </returns> private int GetCellState( int x, int y, IGameField gameField ) { if( this.hasSolidWalls ) { if( x < 0 || x >= gameField.Width ) return 0; if( y < 0 || y >= gameField.Height ) return 0; return gameField.GetCellStateStrict( x, y ) ? 1 : 0; } else { return gameField.GetCellState( x, y ) ? 1 : 0; } }