Пример #1
0
        public DomType Load(GomBinaryReader reader)
        {
            DomEnum result = new DomEnum();

            LoaderHelper.ParseShared(reader, result);

            reader.BaseStream.Position = 0x12;
            var nameOffset = reader.ReadInt16();

            reader.BaseStream.Position = 0x18;
            var numVals   = reader.ReadInt16();
            var valOffset = reader.ReadInt16();

            // Read in names
            reader.BaseStream.Position = nameOffset;
            for (var i = 0; i < numVals; i++)
            {
                var name = reader.ReadNullTerminatedString();
                result.AddName(name);
            }

            // Read in values
            reader.BaseStream.Position = valOffset;
            for (var i = 0; i < numVals; i++)
            {
                var val = reader.ReadInt16();
                result.AddValue(val);
            }

            return(result);
        }
Пример #2
0
        internal static void ParseShared(GomBinaryReader reader, DomType dom)
        {
            long offset = reader.BaseStream.Position;

            //reader.BaseStream.Position = 0x8;
            //dom.Id = reader.ReadUInt64();
            reader.BaseStream.Position = 0x14;
            short nameOffset = reader.ReadInt16();
            short descOffset = reader.ReadInt16();

            reader.BaseStream.Position = nameOffset;
            dom.Name = reader.ReadNullTerminatedString();

            reader.BaseStream.Position = descOffset;
            dom.Description            = reader.ReadNullTerminatedString();

            reader.BaseStream.Position = offset;
        }