public OctreeNode(byte blockSize, BlockData data, int level, Vector3 origin) { this.blockSize = blockSize; this.blockData = data; this.origin = origin; this.subNodes = null; this.level = level; }
public OctreeNode(byte blockSize, int blockID, int level, Vector3 origin) { this.blockSize = blockSize; this.blockData = new BlockData(blockID); this.origin = origin; this.subNodes = null; this.level = level; }
public void SetBlockdata(int x, int y, int z, BlockData blockData) { if (storage != null) { storage.SetBlockData(x,y,z,blockData); } }
// Dispose(bool disposing) executes in two distinct scenarios. // If disposing equals true, the method has been called directly // or indirectly by a user's code. Managed and unmanaged resources // can be disposed. // If disposing equals false, the method has been called by the // runtime from inside the finalizer and you should not reference // other objects. Only unmanaged resources can be disposed. protected virtual void Dispose(bool disposing) { // Check to see if Dispose has already been called. if(!this.disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if(disposing) { // Dispose managed resources. subNodes = null; parent = null; blockData = null; } // Note disposing has been done. disposed = true; } }
public void SetBlockData( int x, int y, int z, BlockData data) { GetNode(x, y, z, true).blockData = data; }