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


C# EndianBinaryReader.ReadString方法代码示例

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


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

示例1: TEX0

 public TEX0(EndianBinaryReader er)
 {
     long basepos = er.BaseStream.Position;
     Signature = er.ReadString(Encoding.ASCII, 4);
     if (Signature != "TEX0") throw new SignatureNotCorrectException(Signature, "TEX0", er.BaseStream.Position - 4);
     SectionSize = er.ReadUInt32();
     TexInfo = new texInfo(er);
     Tex4x4Info = new tex4x4Info(er);
     PlttInfo = new plttInfo(er);
     dictTex = new Dictionary<DictTexData>(er);
     for (int i = 0; i < dictTex.numEntry; i++)
     {
         dictTex[i].Value.ReadData(er, TexInfo.ofsTex, Tex4x4Info.ofsTex, Tex4x4Info.ofsTexPlttIdx, basepos);
     }
     dictPltt = new Dictionary<DictPlttData>(er);
     List<UInt32> Offset = new List<uint>();
     for (int i = 0; i < dictPltt.numEntry; i++)
     {
         Offset.Add(dictPltt[i].Value.offset);
     }
     Offset = Offset.Distinct().ToList();
     Offset.Sort();
     for (int i = 0; i < dictPltt.numEntry; i++)
     {
         int idx = Offset.IndexOf(dictPltt[i].Value.offset);
         if (idx == Offset.Count - 1)
         {
             dictPltt[i].Value.ReadData(er, PlttInfo.ofsPlttData, (uint)er.BaseStream.Length - (Offset[idx] + PlttInfo.ofsPlttData + (uint)basepos), basepos);
         }
         else
         {
             dictPltt[i].Value.ReadData(er, PlttInfo.ofsPlttData, Offset[idx + 1] - Offset[idx], basepos);
         }
     }
 }
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:35,代码来源:TEX0.cs

示例2: POTI

 public POTI(EndianBinaryReader er)
 {
     Signature = er.ReadString(Encoding.ASCII, 4);
     if (Signature != "ITOP") throw new SignatureNotCorrectException(Signature, "ITOP", er.BaseStream.Position - 4);
     NrRoutes = er.ReadUInt16();
     NrPoints = er.ReadUInt16();
     for (int i = 0; i < NrRoutes; i++) Routes.Add(new POTIRoute(er));
 }
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:8,代码来源:POTI.cs

示例3: FFNTHeader

            public UInt32 NrBlocks; //文件内数据块数量 FINF + TGLP + CWDH * N + CMAP * N
            public FFNTHeader(EndianBinaryReader er)
            {

                Signature = er.ReadString(Encoding.ASCII, 4);//FFNT
                Endianness = er.ReadUInt16();
                HeaderSize = er.ReadUInt16();
                Version = er.ReadUInt32();
                FileSize = er.ReadUInt32();
                NrBlocks = er.ReadUInt32();
            }
开发者ID:wmltogether,项目名称:ZLD-TWW-HD-Chinese-Localization-Project,代码行数:11,代码来源:FFNT.cs

示例4: MaterialEntry

 public MaterialEntry(EndianBinaryReader er)
 {
     Name = er.ReadString(Encoding.ASCII, 20).Replace("\0", "");
     BufferColor = er.ReadColor8();
     ConstColors = new Color[6];
     ConstColors[0] = er.ReadColor8();
     ConstColors[1] = er.ReadColor8();
     ConstColors[2] = er.ReadColor8();
     ConstColors[3] = er.ReadColor8();
     ConstColors[4] = er.ReadColor8();
     ConstColors[5] = er.ReadColor8();
     Flags = er.ReadUInt32();
     //Material Flag:
     //  0-1: Nr texMap
     //  2-3: Nr texMatrix
     //  4-5: Nr texCoordGen
     //  6-8: Nr tevStage
     //    9: Has alphaCompare
     //   10: Has blendMode
     //   11: Use Texture Only
     //   12: Separate Blend Mode
     //   14: Has Indirect Parameter
     //15-16: Nr projectionTexGenParameter
     //   17: Has Font Shadow Parameter
     TexMaps = new TexMap[Flags & 3];
     for (int i = 0; i < (Flags & 3); i++)
     {
         TexMaps[i] = new TexMap(er);
     }
     TexMatrices = new TexMatrix[(Flags >> 2) & 3];
     for (int i = 0; i < ((Flags >> 2) & 3); i++)
     {
         TexMatrices[i] = new TexMatrix(er);
     }
     TexCoordGens = new TexCoordGen[(Flags >> 4) & 3];
     for (int i = 0; i < ((Flags >> 4) & 3); i++)
     {
         TexCoordGens[i] = new TexCoordGen(er);
     }
     TevStages = new TevStage[(Flags >> 6) & 7];
     for (int i = 0; i < ((Flags >> 6) & 7); i++)
     {
         TevStages[i] = new TevStage(er);
     }
     if (((Flags >> 9) & 1) == 1) AlphaTest = new AlphaCompare(er);
     if (((Flags >> 10) & 1) == 1) ColorBlendMode = new BlendMode(er);
     if (((Flags >> 12) & 1) == 1) AlphaBlendMode = new BlendMode(er);
     //Some more things
 }
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:49,代码来源:mat1.cs

示例5: MDL0

 public MDL0(EndianBinaryReader er)
 {
     long basepos = er.BaseStream.Position;
     Signature = er.ReadString(Encoding.ASCII, 4);
     if (Signature != "MDL0") throw new SignatureNotCorrectException(Signature, "MDL0", er.BaseStream.Position - 4);
     SectionSize = er.ReadUInt32();
     dict = new Dictionary<MDL0Data>(er);
     models = new Model[dict.numEntry];
     long curpos = er.BaseStream.Position;
     for (int i = 0; i < dict.numEntry; i++)
     {
         er.BaseStream.Position = dict[i].Value.Offset + basepos;//er.GetMarker("ModelSet");
         models[i] = new Model(er);
     }
 }
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:15,代码来源:MDL0.cs

示例6: mat1

 public mat1(EndianBinaryReader er)
 {
     long startpos = er.BaseStream.Position;
     Signature = er.ReadString(Encoding.ASCII, 4);
     if (Signature != "mat1") throw new SignatureNotCorrectException(Signature, "mat1", er.BaseStream.Position - 4);
     SectionSize = er.ReadUInt32();
     NrMaterials = er.ReadUInt32();
     MaterialEntryOffsets = er.ReadUInt32s((int)NrMaterials);
     Materials = new MaterialEntry[NrMaterials];
     for (int i = 0; i < NrMaterials; i++)
     {
         er.BaseStream.Position = startpos + MaterialEntryOffsets[i];
         Materials[i] = new MaterialEntry(er);
     }
     er.BaseStream.Position = startpos + SectionSize;
 }
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:16,代码来源:mat1.cs

示例7: STAG

 public STAG(EndianBinaryReader er)
 {
     Signature = er.ReadString(Encoding.ASCII, 4);
     if (Signature != "STAG") throw new SignatureNotCorrectException(Signature, "STAG", er.BaseStream.Position - 4);
     Unknown1 = er.ReadUInt16();
     NrLaps = er.ReadInt16();
     Unknown2 = er.ReadByte();
     FogEnabled = er.ReadByte() == 1;
     FogTableGenMode = er.ReadByte();
     FogSlope = er.ReadByte();
     UnknownData1 = er.ReadBytes(0x8);
     FogDensity = er.ReadFx32();
     FogColor = Color.FromArgb((int)GFXUtil.ConvertColorFormat(er.ReadUInt16(), ColorFormat.XBGR1555, ColorFormat.ARGB8888));
     FogAlpha = er.ReadUInt16();
     KclColor1 = Color.FromArgb((int)GFXUtil.ConvertColorFormat(er.ReadUInt16(), ColorFormat.XBGR1555, ColorFormat.ARGB8888));
     KclColor2 = Color.FromArgb((int)GFXUtil.ConvertColorFormat(er.ReadUInt16(), ColorFormat.XBGR1555, ColorFormat.ARGB8888));
     KclColor3 = Color.FromArgb((int)GFXUtil.ConvertColorFormat(er.ReadUInt16(), ColorFormat.XBGR1555, ColorFormat.ARGB8888));
     KclColor4 = Color.FromArgb((int)GFXUtil.ConvertColorFormat(er.ReadUInt16(), ColorFormat.XBGR1555, ColorFormat.ARGB8888));
     FrustumFar = er.ReadFx32();
     UnknownData2 = er.ReadBytes(0x4);
 }
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:21,代码来源:STAG.cs

示例8: CMDL

        public CMDL(EndianBinaryReader er)
        {
            Type = er.ReadUInt32();
            Signature = er.ReadString(Encoding.ASCII, 4);
            if (Signature != "CMDL") throw new SignatureNotCorrectException(Signature, "CMDL", er.BaseStream.Position);
            Revision = er.ReadUInt32();
            NameOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
            Unknown2 = er.ReadUInt32();
            Unknown3 = er.ReadUInt32();
            Flags = er.ReadUInt32();
            IsBranchVisible = er.ReadUInt32() == 1;
            NrChildren = er.ReadUInt32();
            Unknown7 = er.ReadUInt32();
            NrAnimationGroupDescriptions = er.ReadUInt32();
            AnimationGroupDescriptionsDictOffset =er.ReadUInt32();
            if (AnimationGroupDescriptionsDictOffset != 0) AnimationGroupDescriptionsDictOffset += (UInt32)er.BaseStream.Position - 4;
            Scale = er.ReadVector3();
            Rotation = er.ReadVector3();
            Translation = er.ReadVector3();
            LocalMatrix = er.ReadSingles(4 * 3);
            WorldMatrix = er.ReadSingles(4 * 3);
            NrMeshes = er.ReadUInt32();
            MeshOffsetsOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
            NrMaterials = er.ReadUInt32();
            MaterialsDictOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
            NrShapes = er.ReadUInt32();
            ShapeOffsetsOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
            NrMeshNodes = er.ReadUInt32();
            MeshNodeVisibilitiesDictOffset = er.ReadUInt32();
            if (MeshNodeVisibilitiesDictOffset != 0) MeshNodeVisibilitiesDictOffset += (UInt32)er.BaseStream.Position - 4;
            Unknown23 = er.ReadUInt32();
            Unknown24 = er.ReadUInt32();
            Unknown25 = er.ReadUInt32();
            if ((Type & 0x80) != 0) SkeletonInfoSOBJOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();

            long curpos = er.BaseStream.Position;
            er.BaseStream.Position = NameOffset;
            Name = er.ReadStringNT(Encoding.ASCII);
            if (AnimationGroupDescriptionsDictOffset != 0)
            {
                er.BaseStream.Position = AnimationGroupDescriptionsDictOffset;
                AnimationInfoDict = new DICT(er);
            }
            er.BaseStream.Position = MeshOffsetsOffset;
            MeshOffsets = new UInt32[NrMeshes];
            for (int i = 0; i < NrMeshes; i++)
            {
                MeshOffsets[i] = (UInt32)er.BaseStream.Position + er.ReadUInt32();
            }
            er.BaseStream.Position = MaterialsDictOffset;
            MaterialsDict = new DICT(er);

            Materials = new MTOB[NrMaterials];
            for (int i = 0; i < NrMaterials; i++)
            {
                er.BaseStream.Position = MaterialsDict[i].DataOffset;
                Materials[i] = new MTOB(er);
            }

            er.BaseStream.Position = ShapeOffsetsOffset;
            ShapeOffsets = new UInt32[NrShapes];
            for (int i = 0; i < NrShapes; i++)
            {
                ShapeOffsets[i] = (UInt32)er.BaseStream.Position + er.ReadUInt32();
            }

            if (MeshNodeVisibilitiesDictOffset != 0)
            {
                er.BaseStream.Position = MeshNodeVisibilitiesDictOffset;
                MeshNodeVisibilitiesDict = new DICT(er);
            }

            AnimationGroupDescriptions = new GraphicsAnimationGroup[NrAnimationGroupDescriptions];
            for (int i = 0; i < NrAnimationGroupDescriptions; i++)
            {
                er.BaseStream.Position = AnimationInfoDict[i].DataOffset;
                AnimationGroupDescriptions[i] = new GraphicsAnimationGroup(er);
            }

            Meshes = new Mesh[NrMeshes];
            for (int i = 0; i < NrMeshes; i++)
            {
                er.BaseStream.Position = MeshOffsets[i];
                Meshes[i] = new Mesh(er);
            }

            Shapes = new SeparateDataShape[NrShapes];
            for (int i = 0; i < NrShapes; i++)
            {
                er.BaseStream.Position = ShapeOffsets[i];
                Shapes[i] = new SeparateDataShape(er);
            }

            MeshNodeVisibilities = new MeshNodeVisibilityCtr[NrMeshNodes];
            for (int i = 0; i < NrMeshNodes; i++)
            {
                er.BaseStream.Position = MeshNodeVisibilitiesDict[i].DataOffset;
                MeshNodeVisibilities[i] = new MeshNodeVisibilityCtr(er);
            }

//.........这里部分代码省略.........
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:101,代码来源:CMDL.cs

示例9: SkeletonCtr

            public SkeletonCtr(EndianBinaryReader er)
            {
                Type = er.ReadUInt32();
                Signature = er.ReadString(Encoding.ASCII, 4);
                if (Signature != "SOBJ") throw new SignatureNotCorrectException(Signature, "SOBJ", er.BaseStream.Position);
                Revision = er.ReadUInt32();
                NameOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                Unknown2 = er.ReadUInt32();
                Unknown3 = er.ReadUInt32();
                NrBones = er.ReadUInt32();
                BoneDictionaryOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                RootBoneOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                ScalingRule = (SkeletonScalingRule)er.ReadUInt32();
                Flags = (SkeletonFlags)er.ReadUInt32();

                long curpos = er.BaseStream.Position;
                er.BaseStream.Position = NameOffset;
                Name = er.ReadStringNT(Encoding.ASCII);
                er.BaseStream.Position = BoneDictionaryOffset;
                BoneDictionary = new DICT(er);
                Bones = new Bone[NrBones];
                for (int i = 0; i < NrBones; i++)
                {
                    er.BaseStream.Position = BoneDictionary[i].DataOffset;
                    Bones[i] = new Bone(er);
                }
                er.BaseStream.Position = curpos;
            }
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:28,代码来源:CMDL.cs

示例10: SeparateDataShape

            public SeparateDataShape(EndianBinaryReader er)
            {
                Type = er.ReadUInt32();
                Signature = er.ReadString(Encoding.ASCII, 4);
                if (Signature != "SOBJ") throw new SignatureNotCorrectException(Signature, "SOBJ", er.BaseStream.Position);
                Revision = er.ReadUInt32();
                NameOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                Unknown2 = er.ReadUInt32();
                Unknown3 = er.ReadUInt32();
                Flags = (ShapeFlags)er.ReadUInt32();
                OrientedBoundingBoxOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                PositionOffset = er.ReadVector3();
                NrPrimitiveSets = er.ReadUInt32();
                PrimitiveSetOffsetsArrayOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                BaseAddress = er.ReadUInt32();
                NrVertexAttributes = er.ReadUInt32();
                VertexAttributeOffsetsArrayOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                BlendShapeOffset = er.ReadUInt32();
                if (BlendShapeOffset != 0) BlendShapeOffset += (UInt32)er.BaseStream.Position - 4;

                long curpos = er.BaseStream.Position;
                er.BaseStream.Position = NameOffset;
                Name = er.ReadStringNT(Encoding.ASCII);
                er.BaseStream.Position = OrientedBoundingBoxOffset;
                BoundingBox = BoundingVolume.FromStream(er);

                er.BaseStream.Position = PrimitiveSetOffsetsArrayOffset;
                PrimitiveSetOffsets = new uint[NrPrimitiveSets];
                for (int i = 0; i < NrPrimitiveSets; i++)
                {
                    PrimitiveSetOffsets[i] = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                }

                er.BaseStream.Position = VertexAttributeOffsetsArrayOffset;
                VertexAttributeOffsets = new uint[NrVertexAttributes];
                for (int i = 0; i < NrVertexAttributes; i++)
                {
                    VertexAttributeOffsets[i] = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                }

                PrimitiveSets = new PrimitiveSet[NrPrimitiveSets];
                for (int i = 0; i < NrPrimitiveSets; i++)
                {
                    er.BaseStream.Position = PrimitiveSetOffsets[i];
                    PrimitiveSets[i] = new PrimitiveSet(er);
                }

                VertexAttributes = new VertexAttributeCtr[NrVertexAttributes];
                if (NrVertexAttributes != 0)
                {
                    for (int i = 0; i < NrVertexAttributes; i++)
                    {
                        er.BaseStream.Position = VertexAttributeOffsets[i];
                        VertexAttributes[i] = VertexAttributeCtr.FromStream(er);
                    }
                }

                if (BlendShapeOffset != 0)
                {
                    er.BaseStream.Position = BlendShapeOffset;
                    BlendShape = new BlendShapeCtr(er);
                }

                er.BaseStream.Position = curpos;
            }
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:65,代码来源:CMDL.cs

示例11: SHDR

                public SHDR(EndianBinaryReader er)
                {
                    Type = er.ReadUInt32();
                    Signature = er.ReadString(Encoding.ASCII, 4);
                    if (Signature != "SHDR") throw new SignatureNotCorrectException(Signature, "SHDR", er.BaseStream.Position);
                    Revision = er.ReadUInt32();
                    NameOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                    Unknown2 = er.ReadUInt32();
                    Unknown3 = er.ReadUInt32();
                    LinkedShaderNameOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                    Unknown4 = er.ReadUInt32();

                    long curpos = er.BaseStream.Position;
                    er.BaseStream.Position = NameOffset;
                    Name = er.ReadStringNT(Encoding.ASCII);
                    er.BaseStream.Position = LinkedShaderNameOffset;
                    LinkedShaderName = er.ReadStringNT(Encoding.ASCII);
                    er.BaseStream.Position = curpos;
                }
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:19,代码来源:CMDL.cs

示例12: MTOB

            public MTOB(EndianBinaryReader er)
            {
                Type = er.ReadUInt32();
                Signature = er.ReadString(Encoding.ASCII, 4);
                if (Signature != "MTOB") throw new SignatureNotCorrectException(Signature, "MTOB", er.BaseStream.Position);
                Revision = er.ReadUInt32();
                NameOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                Unknown2 = er.ReadUInt32();
                Unknown3 = er.ReadUInt32();
                Flags = (MaterialFlags)er.ReadUInt32();
                TexCoordConfig = er.ReadUInt32();
                TranslucencyKind = er.ReadUInt32();
                MaterialColor = new MaterialColorCtr(er);
                Rasterization = new RasterizationCtr(er);
                FragmentOperation = new FragmentOperationCtr(er);
                NrActiveTextureCoordiators = er.ReadUInt32();
                TextureCoordiators = new TextureCoordinatorCtr[3];
                TextureCoordiators[0] = new TextureCoordinatorCtr(er);
                TextureCoordiators[1] = new TextureCoordinatorCtr(er);
                TextureCoordiators[2] = new TextureCoordinatorCtr(er);
                TexMapper0Offset = er.ReadUInt32();
                if (TexMapper0Offset != 0) TexMapper0Offset += (UInt32)er.BaseStream.Position - 4;
                TexMapper1Offset = er.ReadUInt32();
                if (TexMapper1Offset != 0) TexMapper1Offset += (UInt32)er.BaseStream.Position - 4;
                TexMapper2Offset = er.ReadUInt32();
                if (TexMapper2Offset != 0) TexMapper2Offset += (UInt32)er.BaseStream.Position - 4;
                ProcTexMapperOffset = er.ReadUInt32();
                if (ProcTexMapperOffset != 0) ProcTexMapperOffset += (UInt32)er.BaseStream.Position - 4;
                ShaderOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                FragmentShaderOffset = (UInt32)er.BaseStream.Position + er.ReadUInt32();
                ShaderProgramDescriptionIndex = er.ReadUInt32();
                NrShaderParameters = er.ReadUInt32();
                ShaderParametersOffsetArrayOffset = er.ReadUInt32();
                LightSetIndex = er.ReadUInt32();
                FogIndex = er.ReadUInt32();
                ShadingParameterHash = er.ReadUInt32();
                ShaderParametersHash = er.ReadUInt32();
                TextureCoordinatorsHash = er.ReadUInt32();
                TextureSamplersHash = er.ReadUInt32();
                TextureMappersHash = er.ReadUInt32();
                MaterialColorHash = er.ReadUInt32();
                RasterizationHash = er.ReadUInt32();
                FragmentLightingHash = er.ReadUInt32();
                FragmentLightingTableHash = er.ReadUInt32();
                FragmentLightingTableParametersHash = er.ReadUInt32();
                TextureCombinersHash = er.ReadUInt32();
                AlphaTestHash = er.ReadUInt32();
                FragmentOperationHash = er.ReadUInt32();
                MaterialId = er.ReadUInt32();

                long curpos = er.BaseStream.Position;
                er.BaseStream.Position = NameOffset;
                Name = er.ReadStringNT(Encoding.ASCII);
                if (TexMapper0Offset != 0)
                {
                    er.BaseStream.Position = TexMapper0Offset;
                    Tex0 = new TexInfo(er);
                }
                if (TexMapper1Offset != 0)
                {
                    er.BaseStream.Position = TexMapper1Offset;
                    Tex1 = new TexInfo(er);
                }
                if (TexMapper2Offset != 0)
                {
                    er.BaseStream.Position = TexMapper2Offset;
                    Tex2 = new TexInfo(er);
                }
                /*if (TexMapper3Offset != 0)
                {
                    er.BaseStream.Position = Tex3Offset;
                    Tex3 = new TexInfo(er);
                }*/
                //TODO: Procedural Texture Mapper
                er.BaseStream.Position = ShaderOffset;
                Shader = new SHDR(er);
                er.BaseStream.Position = FragmentShaderOffset;
                FragShader = new FragmentShader(er);
                er.BaseStream.Position = curpos;
            }
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:80,代码来源:CMDL.cs

示例13: Read

        public void Read(EndianBinaryReader reader, string type, List<EntityTemplate> templates)
        {
            ChunkType = type;

            if (ChunkType == "RTBL")
            {
            }

            DisplayName = ChunkType;

            Fields = new List<ElementProperty>();

            string searchID = ChunkType.Remove(ChunkType.Length - 1);

            EntityTemplate template = templates.Find(x => x.ChunkID.Contains(searchID));

            Geometry = template.Geometry;

            ActualColor = template.Color;

            DisplayColor = ActualColor;

            foreach (ElementProperty prop in template.Properties)
            {
                switch (prop.Type)
                {
                    case FieldType.Byte:
                        prop.Data = reader.ReadByte();
                        break;
                    case FieldType.Short:
                        prop.Data = reader.ReadInt16();
                        break;
                    case FieldType.Integer:
                        prop.Data = reader.ReadInt32();
                        break;
                    case FieldType.Float:
                        prop.Data = reader.ReadSingle();
                        break;
                    case FieldType.Vector2:
                        prop.Data = new Vector2(reader.ReadSingle(), reader.ReadSingle());
                        break;
                    case FieldType.Vector3:
                        prop.Data = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());

                        if (prop.Name == "Position")
                        {
                            Position = (Vector3)prop.Data;
                        }
                        break;
                    case FieldType.String:
                        string test = reader.ReadString((uint)prop.Length).Trim('\0');
                        prop.Data = test;
                        DisplayName = (string)prop.Data;
                        break;
                    case FieldType.ListByte:
                        List<byte> byteList = new List<byte>();

                        int readerOffsetStorage = (int)reader.BaseStream.Position;

                        if (ChunkType == "RTBL")
                        {
                            int roomListOffset = (int)template.Properties.Find(x => x.Name == "Room List Offset").Data;

                            readerOffsetStorage = (int)reader.BaseStream.Position;

                            reader.BaseStream.Position = roomListOffset;

                            prop.Length = Convert.ToInt32(template.Properties.Find(x => x.Name == "Room Count").Data);
                        }

                        for (int i = 0; i < prop.Length; i++)
                        {
                            byteList.Add(reader.ReadByte());
                        }

                        prop.Data = byteList;

                        if (ChunkType == "RTBL")
                        {
                            reader.BaseStream.Position = readerOffsetStorage;
                        }
                        break;
                    case FieldType.ListShort:
                        List<short> shortList = new List<short>();

                        for (int i = 0; i < prop.Length; i++)
                        {
                            shortList.Add(reader.ReadInt16());
                        }

                        prop.Data = shortList;
                        break;
                    case FieldType.ListRPPN:
                        List<Chunk> rppnList = new List<Chunk>();

                        prop.Data = rppnList;
                        break;
                    case FieldType.Color:
                        Color color = Color.FromArgb((int)reader.ReadByte(), (int)reader.ReadByte(), (int)reader.ReadByte());

//.........这里部分代码省略.........
开发者ID:Sage-of-Mirrors,项目名称:DZxEditor-TWW-Entity-Editor,代码行数:101,代码来源:Main.cs

示例14: EntryNameTableDirectoryEntry

 public EntryNameTableDirectoryEntry(EndianBinaryReader er)
     : base(er)
 {
     entryName = er.ReadString(Encoding.ASCII, entryNameLength & 0x7F);
     directoryID = er.ReadUInt16();
 }
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:6,代码来源:NitroFS.cs

示例15: EntryNameTableFileEntry

 public EntryNameTableFileEntry(EndianBinaryReader er)
     : base(er)
 {
     entryName = er.ReadString(Encoding.ASCII, entryNameLength);
 }
开发者ID:Ermelber,项目名称:EveryFileExplorer,代码行数:5,代码来源:NitroFS.cs


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