static VoxelGenDataMirror[] ReadGenVoxelsFromFile(string FilePath) { FileStream file = File.Open(FilePath, FileMode.Open); VoxelGenDataMirror[] voxels; using (BinaryReader br = new BinaryReader(file)) { int pos = 0; int length = (int)br.BaseStream.Length; int sizeUint = System.Runtime.InteropServices.Marshal.SizeOf(new VoxelGenDataMirror()); voxels = new VoxelGenDataMirror[length / sizeUint]; while (pos * sizeUint < length) { var voxel = new VoxelGenDataMirror(); voxel.voxel = br.ReadUInt32(); voxels[pos++] = voxel; } } return(voxels); }
public bool Equal(VoxelGenDataMirror other) { return(voxel == other.voxel); }