This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public readonly struct Option<T> | |
{ | |
private readonly T value; | |
private readonly bool isSome; | |
private Option(T value, bool isSome) | |
{ | |
this.value = value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[RequireComponent(typeof(MeshFilter))] | |
[RequireComponent(typeof(MeshRenderer))] | |
public class Chunk : MonoBehaviour | |
{ | |
private MeshFilter _meshFilter; | |
public int[,] Heightmap { get; private set; } | |
public bool Initialize(uint chunkSize, uint cellSize, int[,] terrainData, Material material) | |
{ | |
Heightmap = new int[chunkSize, chunkSize]; |