public Chunk this[Position position] { get { Chunk chunk; if (chunks.TryGetValue(position, out chunk)) { return(chunk); } chunk = new Chunk(position, noise); chunks.Add(position, chunk); foreach (Side side in SideExtensions.Sides) { Chunk sideChunk; SByte2 offset = side.Vector(); if (chunks.TryGetValue(new Position(position.X + offset.X, position.Y + offset.Y), out sideChunk)) { sideChunk.neighbours[(byte)side.Opposite()] = chunk; chunk.neighbours[(byte)side] = sideChunk; sideChunk.changed = true; chunk.changed = true; } } return(chunk); } }
public SByte4(SByte2 xy, SByte2 zw) { this.X = xy.X; this.Y = xy.Y; this.Z = zw.X; this.W = zw.Y; }
public SByte4(sbyte x, SByte2 yz, sbyte w) { this.X = x; this.Y = yz.X; this.Z = yz.Y; this.W = w; }
public SByte4(sbyte x, sbyte y, SByte2 zw) { this.X = x; this.Y = y; this.Z = zw.X; this.W = zw.Y; }
public SByte4(SByte2 xy, sbyte z, sbyte w) { this.X = xy.X; this.Y = xy.Y; this.Z = z; this.W = w; }