当前位置: 首页>>代码示例>>C#>>正文


C# BinaryReader.ReadRange方法代码示例

本文整理汇总了C#中System.IO.BinaryReader.ReadRange方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryReader.ReadRange方法的具体用法?C# BinaryReader.ReadRange怎么用?C# BinaryReader.ReadRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.BinaryReader的用法示例。


在下文中一共展示了BinaryReader.ReadRange方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BinaryReader

 void IDefinition.FromArray(byte[] buffer)
 {
     BinaryReader bin = new BinaryReader(new MemoryStream(buffer));
     X = bin.ReadRange();
     Y = bin.ReadRange();
     Z = bin.ReadRange();
     U = bin.ReadRange();
     V = bin.ReadRange();
 }
开发者ID:jacksoncougar,项目名称:Moonfish-Editor,代码行数:9,代码来源:model_definitions.cs

示例2: GetRangeHandler

        static byte[] GetRangeHandler(BinaryReader requestReader, World world)
        {
            var requestedRange = requestReader.ReadRange();
            var rangeData = world.GetRange(requestedRange);

            using(var responseStream = new MemoryStream())
            {
                using(var responseWriter = new BinaryWriter(responseStream))
                {
                    responseWriter.Write((byte)WorldResponse.Ok);
                    responseWriter.Write(rangeData.Range);
                    responseWriter.Write(rangeData.Data);
                }

                return responseStream.ToArray();
            }
        }
开发者ID:Jaecen,项目名称:Robotopia,代码行数:17,代码来源:Program.cs

示例3: FlockDefinitionBlock

 public FlockDefinitionBlock(BinaryReader binaryReader)
 {
     this.bsp = binaryReader.ReadShortBlockIndex1();
     this.padding = binaryReader.ReadBytes(2);
     this.boundingVolume = binaryReader.ReadShortBlockIndex1();
     this.flags = (Flags)binaryReader.ReadInt16();
     this.ecologyMarginWusDistanceFromEcologyBoundaryThatCreatureBeginsToBeRepulsed = binaryReader.ReadSingle();
     {
         var count = binaryReader.ReadInt32();
         var address = binaryReader.ReadInt32();
         var elementSize = Marshal.SizeOf(typeof(FlockSourceBlock));
         this.sources = new FlockSourceBlock[count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < count; ++i)
             {
                 binaryReader.BaseStream.Position = address + i * elementSize;
                 this.sources[i] = new FlockSourceBlock(binaryReader);
             }
         }
     }
     {
         var count = binaryReader.ReadInt32();
         var address = binaryReader.ReadInt32();
         var elementSize = Marshal.SizeOf(typeof(FlockSinkBlock));
         this.sinks = new FlockSinkBlock[count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < count; ++i)
             {
                 binaryReader.BaseStream.Position = address + i * elementSize;
                 this.sinks[i] = new FlockSinkBlock(binaryReader);
             }
         }
     }
     this.productionFrequencyBoidsSecHowFrequentlyBoidsAreProducedAtOneOfTheSourcesLimitedByTheMaxBoidCount = binaryReader.ReadSingle();
     this.scale = binaryReader.ReadRange();
     this.creature = binaryReader.ReadTagReference();
     this.boidCount = binaryReader.ReadInt32();
     this.neighborhoodRadiusWorldUnitsDistanceWithinWhichOneBoidIsAffectedByAnother = binaryReader.ReadSingle();
     this.avoidanceRadiusWorldUnitsDistanceThatABoidTriesToMaintainFromAnother = binaryReader.ReadSingle();
     this.forwardScale01WeightGivenToBoidsDesireToFlyStraightAhead = binaryReader.ReadSingle();
     this.alignmentScale01WeightGivenToBoidsDesireToAlignItselfWithNeighboringBoids = binaryReader.ReadSingle();
     this.avoidanceScale01WeightGivenToBoidsDesireToAvoidCollisionsWithOtherBoidsWhenWithinTheAvoidanceRadius = binaryReader.ReadSingle();
     this.levelingForceScale01WeightGivenToBoidsDesireToFlyLevel = binaryReader.ReadSingle();
     this.sinkScale01WeightGivenToBoidsDesireToFlyTowardsItsSinks = binaryReader.ReadSingle();
     this.perceptionAngleDegreesAngleFromForwardWithinWhichOneBoidCanPerceiveAndReactToAnother = binaryReader.ReadSingle();
     this.averageThrottle01ThrottleAtWhichBoidsWillNaturallyFly = binaryReader.ReadSingle();
     this.maximumThrottle01MaximumThrottleApplicable = binaryReader.ReadSingle();
     this.positionScale01WeightGivenToBoidsDesireToBeNearFlockCenter = binaryReader.ReadSingle();
     this.positionMinRadiusWusDistanceToFlockCenterBeyondWhichAnAttractingForceIsApplied = binaryReader.ReadSingle();
     this.positionMaxRadiusWusDistanceToFlockCenterAtWhichTheMaximumAttractingForceIsApplied = binaryReader.ReadSingle();
     this.movementWeightThresholdTheThresholdOfAccumulatedWeightOverWhichMovementOccurs = binaryReader.ReadSingle();
     this.dangerRadiusWusDistanceWithinWhichBoidsWillAvoidADangerousObjectEGThePlayer = binaryReader.ReadSingle();
     this.dangerScaleWeightGivenToBoidsDesireToAvoidDanger = binaryReader.ReadSingle();
     this.randomOffsetScale01WeightGivenToBoidsRandomHeadingOffset = binaryReader.ReadSingle();
     this.randomOffsetPeriodSeconds = binaryReader.ReadRange();
     this.flockName = binaryReader.ReadStringID();
 }
开发者ID:jacksoncougar,项目名称:Moonfish-Editor,代码行数:59,代码来源:Scenario.cs

示例4: ScenarioAtmosphericFogPalette

 public ScenarioAtmosphericFogPalette(BinaryReader binaryReader)
 {
     this.name = binaryReader.ReadStringID();
     this.color = binaryReader.ReadColorR8G8B8();
     this.spreadDistanceWorldUnitsHowFarFogSpreadsIntoAdjacentClusters0DefaultsTo1 = binaryReader.ReadSingle();
     this.padding = binaryReader.ReadBytes(4);
     this.maximumDensity01FogDensityClampsToThisValue = binaryReader.ReadSingle();
     this.startDistanceWorldUnitsBeforeThisDistanceThereIsNoFog = binaryReader.ReadSingle();
     this.opaqueDistanceWorldUnitsFogBecomesOpaqueMaximumDensityAtThisDistanceFromViewer = binaryReader.ReadSingle();
     this.color0 = binaryReader.ReadColorR8G8B8();
     this.padding0 = binaryReader.ReadBytes(4);
     this.maximumDensity01FogDensityClampsToThisValue0 = binaryReader.ReadSingle();
     this.startDistanceWorldUnitsBeforeThisDistanceThereIsNoFog0 = binaryReader.ReadSingle();
     this.opaqueDistanceWorldUnitsFogBecomesOpaqueMaximumDensityAtThisDistanceFromViewer0 = binaryReader.ReadSingle();
     this.padding1 = binaryReader.ReadBytes(4);
     this.planarColor = binaryReader.ReadColorR8G8B8();
     this.planarMaxDensity01 = binaryReader.ReadSingle();
     this.planarOverrideAmount01 = binaryReader.ReadSingle();
     this.planarMinDistanceBiasWorldUnitsDontAsk = binaryReader.ReadSingle();
     this.padding2 = binaryReader.ReadBytes(44);
     this.patchyColor = binaryReader.ReadColorR8G8B8();
     this.padding3 = binaryReader.ReadBytes(12);
     this.patchyDensity01 = binaryReader.ReadSingle();
     this.patchyDistanceWorldUnits = binaryReader.ReadRange();
     this.padding4 = binaryReader.ReadBytes(32);
     this.patchyFog = binaryReader.ReadTagReference();
     {
         var count = binaryReader.ReadInt32();
         var address = binaryReader.ReadInt32();
         var elementSize = Marshal.SizeOf(typeof(ScenarioAtmosphericFogMixerBlock));
         this.mixers = new ScenarioAtmosphericFogMixerBlock[count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < count; ++i)
             {
                 binaryReader.BaseStream.Position = address + i * elementSize;
                 this.mixers[i] = new ScenarioAtmosphericFogMixerBlock(binaryReader);
             }
         }
     }
     this.amount01 = binaryReader.ReadSingle();
     this.threshold01 = binaryReader.ReadSingle();
     this.brightness01 = binaryReader.ReadSingle();
     this.gammaPower = binaryReader.ReadSingle();
     this.cameraImmersionFlags = (CameraImmersionFlags)binaryReader.ReadInt16();
     this.padding5 = binaryReader.ReadBytes(2);
 }
开发者ID:jacksoncougar,项目名称:Moonfish-Editor,代码行数:47,代码来源:Scenario.cs

示例5: SoundSceneryDatumStruct

 public SoundSceneryDatumStruct(BinaryReader binaryReader)
 {
     this.volumeType = (VolumeType)binaryReader.ReadInt32();
     this.height = binaryReader.ReadSingle();
     this.overrideDistanceBounds = binaryReader.ReadRange();
     this.overrideConeAngleBounds = binaryReader.ReadRange();
     this.overrideOuterConeGainDb = binaryReader.ReadSingle();
 }
开发者ID:jacksoncougar,项目名称:Moonfish-Editor,代码行数:8,代码来源:Scenario.cs

示例6: BinaryReader

 void IDefinition.FromArray(byte[] buffer)
 {
     BinaryReader bin = new BinaryReader(new MemoryStream(buffer));
     x = bin.ReadRange();
     y = bin.ReadRange();
     z = bin.ReadRange();
 }
开发者ID:jacksoncougar,项目名称:moonfish,代码行数:7,代码来源:Mesh.cs

示例7: GlobalGeometryCompressionInfoBlock

 public GlobalGeometryCompressionInfoBlock(BinaryReader binaryReader)
 {
     this.positionBoundsX = binaryReader.ReadRange();
     this.positionBoundsY = binaryReader.ReadRange();
     this.positionBoundsZ = binaryReader.ReadRange();
     this.texcoordBoundsX = binaryReader.ReadRange();
     this.texcoordBoundsY = binaryReader.ReadRange();
     this.secondaryTexcoordBoundsX = binaryReader.ReadRange();
     this.secondaryTexcoordBoundsY = binaryReader.ReadRange();
 }
开发者ID:jacksoncougar,项目名称:Moonfish-Editor,代码行数:10,代码来源:RenderModel.cs

示例8: ErrorReportsBlock

 public ErrorReportsBlock(BinaryReader binaryReader)
 {
     this.type = (Type)binaryReader.ReadInt16();
     this.flags = (Flags)binaryReader.ReadInt16();
     this.paddingtext = binaryReader.ReadBytes(8);
     this.sourceFilename = binaryReader.ReadString32();
     this.sourceLineNumber = binaryReader.ReadInt32();
     this.vertices = ReadVertices(binaryReader);
     this.vectors = ReadVectors(binaryReader);
     this.lines = ReadLines(binaryReader);
     this.triangles = ReadTriangles(binaryReader);
     this.quads = ReadQuads(binaryReader);
     this.comments = ReadComments(binaryReader);
     this.padding = binaryReader.ReadBytes(380);
     this.reportKey = binaryReader.ReadInt32();
     this.nodeIndex = binaryReader.ReadInt32();
     this.boundsX = binaryReader.ReadRange();
     this.boundsY = binaryReader.ReadRange();
     this.boundsZ = binaryReader.ReadRange();
     this.color = binaryReader.ReadVector4();
     this.padding0 = binaryReader.ReadBytes(84);
 }
开发者ID:jacksoncougar,项目名称:Moonfish-Editor,代码行数:22,代码来源:RenderModel.cs

示例9: StructureBspAudibilityBlock

 public StructureBspAudibilityBlock(BinaryReader binaryReader)
 {
     this.doorPortalCount = binaryReader.ReadInt32();
     this.clusterDistanceBounds = binaryReader.ReadRange();
     {
         var elementSize = Marshal.SizeOf(typeof(DoorEncodedPasBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.encodedDoorPas = new DoorEncodedPasBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.encodedDoorPas[i] = new DoorEncodedPasBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(ClusterDoorPortalEncodedPasBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.clusterDoorPortalEncodedPas = new ClusterDoorPortalEncodedPasBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.clusterDoorPortalEncodedPas[i] = new ClusterDoorPortalEncodedPasBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(AiDeafeningEncodedPasBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.aiDeafeningPas = new AiDeafeningEncodedPasBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.aiDeafeningPas[i] = new AiDeafeningEncodedPasBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(EncodedClusterDistancesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.clusterDistances = new EncodedClusterDistancesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.clusterDistances[i] = new EncodedClusterDistancesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(OccluderToMachineDoorMapping));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.machineDoorMapping = new OccluderToMachineDoorMapping[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.machineDoorMapping[i] = new OccluderToMachineDoorMapping(binaryReader);
             }
         }
     }
 }
开发者ID:jacksoncougar,项目名称:Moonfish-Editor,代码行数:70,代码来源:StructureBinarySeperationPlane.cs

示例10: ErrorReportsBlock

 public ErrorReportsBlock(BinaryReader binaryReader)
 {
     this.type = (Type)binaryReader.ReadInt16();
     this.flags = (Flags)binaryReader.ReadInt16();
     this.paddingtext = binaryReader.ReadBytes(8);
     this.sourceFilename = binaryReader.ReadString32();
     this.sourceLineNumber = binaryReader.ReadInt32();
     {
         var elementSize = Marshal.SizeOf(typeof(ErrorReportVerticesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.vertices = new ErrorReportVerticesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.vertices[i] = new ErrorReportVerticesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(ErrorReportVectorsBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.vectors = new ErrorReportVectorsBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.vectors[i] = new ErrorReportVectorsBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(ErrorReportLinesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.lines = new ErrorReportLinesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.lines[i] = new ErrorReportLinesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(ErrorReportTrianglesBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.triangles = new ErrorReportTrianglesBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.triangles[i] = new ErrorReportTrianglesBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(ErrorReportQuadsBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.quads = new ErrorReportQuadsBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.quads[i] = new ErrorReportQuadsBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(ErrorReportCommentsBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.comments = new ErrorReportCommentsBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.comments[i] = new ErrorReportCommentsBlock(binaryReader);
             }
         }
     }
     this.padding = binaryReader.ReadBytes(380);
     this.reportKey = binaryReader.ReadInt32();
     this.nodeIndex = binaryReader.ReadInt32();
     this.boundsX = binaryReader.ReadRange();
     this.boundsY = binaryReader.ReadRange();
     this.boundsZ = binaryReader.ReadRange();
     this.color = binaryReader.ReadVector4();
     this.padding0 = binaryReader.ReadBytes(84);
 }
开发者ID:jacksoncougar,项目名称:Moonfish-Editor,代码行数:94,代码来源:StructureBinarySeperationPlane.cs

示例11: StructureBspClusterBlock

 public StructureBspClusterBlock(BinaryReader binaryReader)
 {
     this.sectionInfo = new GlobalGeometrySectionInfoStruct(binaryReader);
     this.geometryBlockInfo = new Moonfish.Tags.GlobalGeometryBlockInfoStruct(binaryReader);
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspClusterDataBlockNew));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.clusterData = new StructureBspClusterDataBlockNew[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.clusterData[i] = new StructureBspClusterDataBlockNew(binaryReader);
             }
         }
     }
     this.boundsX = binaryReader.ReadRange();
     this.boundsY = binaryReader.ReadRange();
     this.boundsZ = binaryReader.ReadRange();
     this.scenarioSkyIndex = binaryReader.ReadByte();
     this.mediaIndex = binaryReader.ReadByte();
     this.scenarioVisibleSkyIndex = binaryReader.ReadByte();
     this.scenarioAtmosphericFogIndex = binaryReader.ReadByte();
     this.planarFogDesignator = binaryReader.ReadByte();
     this.visibleFogPlaneIndex = binaryReader.ReadByte();
     this.backgroundSound = binaryReader.ReadShortBlockIndex1();
     this.soundEnvironment = binaryReader.ReadShortBlockIndex1();
     this.weather = binaryReader.ReadShortBlockIndex1();
     this.transitionStructureBSP = binaryReader.ReadInt16();
     this.padding = binaryReader.ReadBytes(2);
     this.padding0 = binaryReader.ReadBytes(4);
     this.flags = (Flags)binaryReader.ReadInt16();
     this.padding1 = binaryReader.ReadBytes(2);
     {
         var elementSize = Marshal.SizeOf(typeof(PredictedResourceBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.predictedResources = new PredictedResourceBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.predictedResources[i] = new PredictedResourceBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspClusterPortalIndexBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.portals = new StructureBspClusterPortalIndexBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.portals[i] = new StructureBspClusterPortalIndexBlock(binaryReader);
             }
         }
     }
     this.checksumFromStructure = binaryReader.ReadInt32();
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspClusterInstancedGeometryIndexBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.instancedGeometryIndices = new StructureBspClusterInstancedGeometryIndexBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.instancedGeometryIndices[i] = new StructureBspClusterInstancedGeometryIndexBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(GlobalGeometrySectionStripIndexBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.indexReorderTable = new GlobalGeometrySectionStripIndexBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.indexReorderTable[i] = new GlobalGeometrySectionStripIndexBlock(binaryReader);
             }
         }
     }
     this.paddingcollisionMoppCode = binaryReader.ReadBytes(8);
 }
开发者ID:jacksoncougar,项目名称:Moonfish-Editor,代码行数:89,代码来源:StructureBinarySeperationPlane.cs

示例12: ScenarioStructureBSP

 public ScenarioStructureBSP(BinaryReader binaryReader)
 {
     {
         var elementSize = Marshal.SizeOf(typeof(GlobalTagImportInfoBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.importInfo = new GlobalTagImportInfoBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.importInfo[i] = new GlobalTagImportInfoBlock(binaryReader);
             }
         }
     }
     this.padding = binaryReader.ReadBytes(4);
     {
         var elementSize = Marshal.SizeOf(typeof(StructureCollisionMaterialsBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.collisionMaterials = new StructureCollisionMaterialsBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.collisionMaterials[i] = new StructureCollisionMaterialsBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(GlobalCollisionBspBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.collisionBSP = new GlobalCollisionBspBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.collisionBSP[i] = new GlobalCollisionBspBlock(binaryReader);
             }
         }
     }
     this.vehicleFloorWorldUnitsHeightBelowWhichVehiclesGetPushedUpByAnUnstoppableForce = binaryReader.ReadSingle();
     this.vehicleCeilingWorldUnitsHeightAboveWhichVehiclesGetPushedDownByAnUnstoppableForce = binaryReader.ReadSingle();
     {
         var elementSize = Marshal.SizeOf(typeof(UNUSEDStructureBspNodeBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.uNUSEDNodes = new UNUSEDStructureBspNodeBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.uNUSEDNodes[i] = new UNUSEDStructureBspNodeBlock(binaryReader);
             }
         }
     }
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspLeafBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.leaves = new StructureBspLeafBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.leaves[i] = new StructureBspLeafBlock(binaryReader);
             }
         }
     }
     this.worldBoundsX = binaryReader.ReadRange();
     this.worldBoundsY = binaryReader.ReadRange();
     this.worldBoundsZ = binaryReader.ReadRange();
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspSurfaceReferenceBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.surfaceReferences = new StructureBspSurfaceReferenceBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.surfaceReferences[i] = new StructureBspSurfaceReferenceBlock(binaryReader);
             }
         }
     }
     this.paddingclusterData = binaryReader.ReadBytes(8);
     {
         var elementSize = Marshal.SizeOf(typeof(StructureBspClusterPortalBlock));
         var blamPointer = binaryReader.ReadBlamPointer(elementSize);
         this.clusterPortals = new StructureBspClusterPortalBlock[blamPointer.Count];
         using (binaryReader.BaseStream.Pin())
         {
             for (int i = 0; i < blamPointer.Count; ++i)
             {
                 binaryReader.BaseStream.Position = blamPointer[i];
                 this.clusterPortals[i] = new StructureBspClusterPortalBlock(binaryReader);
             }
         }
     }
//.........这里部分代码省略.........
开发者ID:jacksoncougar,项目名称:Moonfish-Editor,代码行数:101,代码来源:StructureBinarySeperationPlane.cs


注:本文中的System.IO.BinaryReader.ReadRange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。