public static void ImportBP(this DysonSphereLayer _this, BinaryReader r) { r.ReadInt32(); _this.id = r.ReadInt32(); _this.orbitRadius = r.ReadSingle(); _this.orbitRotation.x = r.ReadSingle(); _this.orbitRotation.y = r.ReadSingle(); _this.orbitRotation.z = r.ReadSingle(); _this.orbitRotation.w = r.ReadSingle(); _this.orbitAngularSpeed = r.ReadSingle(); _this.currentAngle = r.ReadSingle(); _this.currentRotation.x = r.ReadSingle(); _this.currentRotation.y = r.ReadSingle(); _this.currentRotation.z = r.ReadSingle(); _this.currentRotation.w = r.ReadSingle(); _this.nextRotation.x = r.ReadSingle(); _this.nextRotation.y = r.ReadSingle(); _this.nextRotation.z = r.ReadSingle(); _this.nextRotation.w = r.ReadSingle(); _this.gridMode = r.ReadInt32(); _this.ResetNew(); int num = r.ReadInt32(); Traverse.Create(_this).Method("SetNodeCapacity", num).GetValue(); _this.nodeCursor = r.ReadInt32(); _this.nodeRecycleCursor = r.ReadInt32(); for (int i = 1; i < _this.nodeCursor; i++) { int num2 = r.ReadInt32(); if (num2 != 0) { Assert.True(num2 == i); DysonNode dysonNode = new DysonNode(); dysonNode.ImportBP(r); Assert.True(dysonNode.id == i); if (dysonNode.id != i || num2 != i) { throw new Exception($"node id doesn't match! {dysonNode.id} and {num2}"); } _this.nodePool[i] = dysonNode; } } for (int j = 0; j < _this.nodeRecycleCursor; j++) { _this.nodeRecycle[j] = r.ReadInt32(); } num = r.ReadInt32(); Traverse.Create(_this).Method("SetFrameCapacity", num).GetValue(); _this.frameCursor = r.ReadInt32(); _this.frameRecycleCursor = r.ReadInt32(); for (int k = 1; k < _this.frameCursor; k++) { int num3 = r.ReadInt32(); if (num3 != 0) { Assert.True(num3 == k); DysonFrame dysonFrame = new DysonFrame(); dysonFrame.ImportBP(r, _this.dysonSphere); Assert.True(dysonFrame.id == k); if (dysonFrame.id != k || num3 != k) { throw new Exception("frame id doesn't match!"); } _this.framePool[k] = dysonFrame; } } for (int l = 0; l < _this.frameRecycleCursor; l++) { _this.frameRecycle[l] = r.ReadInt32(); } num = r.ReadInt32(); Traverse.Create(_this).Method("SetShellCapacity", num).GetValue(); _this.shellCursor = r.ReadInt32(); _this.shellRecycleCursor = r.ReadInt32(); for (int m = 1; m < _this.shellCursor; m++) { int num4 = r.ReadInt32(); if (num4 != 0) { Assert.True(num4 == m); DysonShell dysonShell = new DysonShell(_this); dysonShell.ImportBP(r, _this.dysonSphere); Assert.True(dysonShell.id == m); if (dysonShell.id != m || num4 != m) { throw new Exception("shell id doesn't match!"); } _this.shellPool[m] = dysonShell; } } for (int n = 0; n < _this.shellRecycleCursor; n++) { _this.shellRecycle[n] = r.ReadInt32(); } for (int num5 = 1; num5 < _this.nodeCursor; num5++) { if (_this.nodePool[num5] != null && _this.nodePool[num5].id == num5) { _this.nodePool[num5].RecalcSpReq(); _this.nodePool[num5].RecalcCpReq(); } } }