Esempio n. 1
0
        public VariableHeader GetNextRecordVariableMeta(IBinaryReadStream stream)
        {
            RecordType rec = new RecordType(stream.GetInt32());

            if (rec == Mutagen.Bethesda.Internals.Constants.Group)
            {
                return(this.GroupConstants.VariableMeta(stream.GetSpan(this.GroupConstants.HeaderLength)));
            }
            else
            {
                return(this.MajorConstants.VariableMeta(stream.GetSpan(this.MajorConstants.HeaderLength)));
            }
        }
Esempio n. 2
0
 public bool TryGetGroupFrame(IBinaryReadStream stream, out GroupFrame frame, int offset = 0, bool checkIsGroup = true)
 {
     if (!TryGetGroup(stream, out var meta, offset: offset, checkIsGroup: checkIsGroup))
     {
         frame = default;
         return(false);
     }
     frame = new GroupFrame(meta, stream.GetSpan(checked ((int)meta.TotalLength)));
     return(true);
 }
Esempio n. 3
0
 public bool TryGetSubrecordFrame(IBinaryReadStream stream, RecordType targetType, out SubrecordFrame frame)
 {
     if (!TryGetSubrecord(stream, targetType, out var meta))
     {
         frame = default;
         return(false);
     }
     frame = new SubrecordFrame(meta, stream.GetSpan(meta.TotalLength));
     return(true);
 }
Esempio n. 4
0
 public bool TryGetMod(IBinaryReadStream stream, out ModHeader header)
 {
     if (stream.Remaining < this.ModHeaderLength)
     {
         header = default;
         return(false);
     }
     header = new ModHeader(this, stream.GetSpan(this.ModHeaderLength));
     return(true);
 }
Esempio n. 5
0
        public SubrecordFrame GetSubrecordFrame(IBinaryReadStream stream, int offset = 0)
        {
            var meta = GetSubrecord(stream, offset);

            return(new SubrecordFrame(meta, stream.GetSpan(meta.TotalLength, offset: offset)));
        }
Esempio n. 6
0
 public SubrecordHeader GetSubrecord(IBinaryReadStream stream, int offset = 0) => new SubrecordHeader(this, stream.GetSpan(this.SubConstants.HeaderLength, offset));
Esempio n. 7
0
        public MajorRecordFrame GetMajorRecordFrame(IBinaryReadStream stream, int offset = 0)
        {
            var meta = GetMajorRecord(stream, offset);

            return(new MajorRecordFrame(meta, stream.GetSpan(checked ((int)meta.TotalLength), offset: offset)));
        }
Esempio n. 8
0
 public MajorRecordHeader GetMajorRecord(IBinaryReadStream stream, int offset = 0) => new MajorRecordHeader(this, stream.GetSpan(this.MajorConstants.HeaderLength, offset));
Esempio n. 9
0
        public GroupFrame GetGroupFrame(IBinaryReadStream stream, int offset = 0)
        {
            var meta = GetGroup(stream, offset);

            return(new GroupFrame(meta, stream.GetSpan(checked ((int)meta.TotalLength), offset: offset)));
        }
Esempio n. 10
0
 public GroupHeader GetGroup(IBinaryReadStream stream, int offset = 0) => new GroupHeader(this, stream.GetSpan(this.GroupConstants.HeaderLength, offset));
Esempio n. 11
0
 public ModHeader GetMod(IBinaryReadStream stream) => new ModHeader(this, stream.GetSpan(this.ModHeaderLength));
Esempio n. 12
0
 public VariableHeader GetVariableMeta(IBinaryReadStream stream, int offset = 0) => new VariableHeader(this, stream.GetSpan(this.HeaderLength, offset));