Ejemplo 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);
            }
        }
Ejemplo n.º 2
0
        private void LoadFields()
        {
            var pos = _br.Stream.Position;

            _br.Stream.Position = _gb.Header.FieldOffset;
            for (var i = 0; i < _gb.Header.FieldCount; i++)
            {
                var q  = _br.GetUInt32Queue(GffBasicFrame.ValueCount);
                var ff = new GffFieldFrame(q.Dequeue(), q.Dequeue(), q.Dequeue());
                _gb.FieldArray.Add(ff);
            }
            _br.Stream.Position = pos;
        }