Beispiel #1
0
        public override void Read(EndianBinReader reader)
        {
            var pageNameOffset = _gt7 ? reader.ReadInt64() : reader.ReadUInt32();
            var pairUnitCount  = reader.ReadUInt32();

            reader.ReadUInt32(); // Unk
            var pairUnitOffset = _gt7 ? reader.ReadInt64() : reader.ReadUInt32();

            reader.BaseStream.Position = (int)pageNameOffset;
            Name = reader.ReadNullTerminatedString();

            for (int i = 0; i < pairUnitCount; i++)
            {
                reader.BaseStream.Position = pairUnitOffset + (i * (_gt7 ? EntrySizeGT7 : EntrySize));
                int id = reader.ReadInt32();

                ushort labelLen = reader.ReadUInt16();
                ushort valueLen = reader.ReadUInt16();

                long labelOffset = _gt7 ? reader.ReadInt64() : reader.ReadUInt32();
                long valueOffset = _gt7 ? reader.ReadInt64() : reader.ReadUInt32();

                reader.BaseStream.Position = labelOffset;
                string label = ReadString(reader, labelLen);

                reader.BaseStream.Position = valueOffset;
                string value = ReadString(reader, valueLen);

                var pair = new RTextPairUnit(id, label, value);
                PairUnits.Add(label, pair);
            }
        }