public abstract void ReadBinary(ESPReader reader);
Example #2
0
 public override void ReadTypeData(ESPReader reader)
 {
     Index = reader.ReadInt32();
 }
Example #3
0
 public abstract void ReadTypeData(ESPReader reader);
Example #4
0
 public override void ReadTypeData(ESPReader reader)
 {
     Cell = reader.Read <FormID>();
 }
Example #5
0
        public void ReadBinary(ESPReader reader, MemoryMappedFile source)
        {
            Tag  = reader.ReadTag();
            Size = reader.ReadUInt32() - 24;
            ReadTypeData(reader);
            GroupType thisType = (GroupType)reader.ReadUInt32();

            Debug.Assert(thisType == type);
            LastModified = new DateStamp();
            LastModified.ReadBinary(reader);
            Unknown = reader.ReadBytes(6);

            long offset = reader.BaseStream.Position;

            while (reader.BaseStream.Position < offset + Size)
            {
                if (reader.PeekTag() == "GRUP")
                {
                    Group newGroup = Group.CreateGroup(reader);

                    if (GroupAdded != null)
                    {
                        GroupAdded(newGroup);
                    }

                    newGroup.GroupAdded += (g) =>
                    {
                        AllSubgroups.Add(g);

                        if (GroupAdded != null)
                        {
                            GroupAdded(g);
                        }
                    };

                    newGroup.RecordViewAdded += (r) =>
                    {
                        AllRecordViews.Add(r);

                        if (RecordViewAdded != null)
                        {
                            RecordViewAdded(r);
                        }
                    };

                    Children.Add(newGroup);
                    AllSubgroups.Add(newGroup);

                    newGroup.ReadBinary(reader, source);
                }
                else
                {
                    RecordView newView = new RecordView(reader, source);
                    ChildRecordViews.Add(newView);
                    AllRecordViews.Add(newView);

                    if (RecordViewAdded != null)
                    {
                        RecordViewAdded(newView);
                    }
                }
            }
        }