Exemplo n.º 1
0
        private void CreateFrames(GffComponent cpnt)
        {
            var value = cpnt as GffStruct;

            if (value != null)
            {
                var sf = new GffStructFrame();
                _gb.StructArray.Add(sf);
                DsaS.Add(sf, value);
            }
            if (!(cpnt is GffInListStruct || cpnt is GffRootStruct))
            {
                var ff = new GffFieldFrame();
                _gb.FieldArray.Add(ff);
                DfaF.Add(ff, cpnt);
            }
            if (!GffComponent.IsComposite(cpnt.Type))
            {
                return;
            }
            var cpsit = cpnt as GffComposite;

            if (cpsit == null)
            {
                return;
            }
            foreach (var child in cpsit)
            {
                CreateFrames(child);
            }
        }
Exemplo n.º 2
0
        private void LoadStructures()
        {
            var pos = _br.Stream.Position;

            _br.Stream.Position = _gb.Header.StructOffset;
            for (var i = 0; i < _gb.Header.StructCount; i++)
            {
                var q  = _br.GetUInt32Queue(GffBasicFrame.ValueCount);
                var sf = new GffStructFrame(q.Dequeue(), q.Dequeue(), q.Dequeue());
                _gb.StructArray.Add(sf);
            }
            _br.Stream.Position = pos;
        }
Exemplo n.º 3
0
        private IEnumerable <uint> GetStructFieldIndices(GffStructFrame sFrame)
        {
            var fieldIndices = new List <uint>();

            if (sFrame.FieldCount > 1)
            {
                var br  = new LatinBinaryReader(_gbase.FieldIndicesArray);
                var pos = br.Stream.Position;
                br.Stream.Position = sFrame.DataOrDataOffset;
                fieldIndices       = br.GetUInt32List((int)sFrame.FieldCount);
                br.Stream.Position = pos;
            }
            else if (sFrame.FieldCount == 1)
            {
                fieldIndices.Add(sFrame.DataOrDataOffset);
            }
            return(fieldIndices);
        }