Пример #1
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameId, uint size)
        {
            var endRead = reader.Position + size;
            var name    = string.Empty;

            while (reader.Position < endRead)
            {
                name = reader.ReadString(4);

                switch (name)
                {
                case "HEDR":
                    Header = new HEDRSubRecord();
                    Header.Deserialize(reader, name);
                    break;

                case "OFST":
                    Offset = new BytesSubRecord();
                    Offset.Deserialize(reader, name);
                    break;

                case "DELE":
                    DELE = new BytesSubRecord();
                    DELE.Deserialize(reader, name);
                    break;

                case "CNAM":
                    Author = new STRSubRecord();
                    Author.Deserialize(reader, name);
                    break;

                case "SNAM":
                    Description = new STRSubRecord();
                    Description.Deserialize(reader, name);
                    break;

                case "MAST":
                    Master = new STRSubRecord();
                    Master.Deserialize(reader, name);
                    break;

                case "DATA":
                    FileSize = new UInt64SubRecord();
                    FileSize.Deserialize(reader, name);
                    break;

                default:
                    var dSize = reader.ReadInt16();
                    reader.ReadBytes(dSize);
                    break;
                }
            }
        }
Пример #2
0
        protected override void ExtractSubRecords(BetterReader reader, GameID gameID, uint size)
        {
            var bytes = reader.ReadBytes((int)size);
            var name  = string.Empty;

            using (var stream = new BetterMemoryReader(bytes))
            {
                var end = stream.Length;

                while (stream.Position < end)
                {
                    name = stream.ReadString(4);

                    switch (name)
                    {
                    case "EDID":
                        EDID = new STRSubRecord();
                        EDID.Deserialize(stream, name);
                        break;

                    case "FULL":
                        FULL = new STRSubRecord();
                        FULL.Deserialize(stream, name);
                        break;

                    case "DATA":
                        DATA = new ByteSubRecord();
                        DATA.Deserialize(stream, name);
                        break;

                    case "XCLL":
                        XCLL = new BytesSubRecord();
                        XCLL.Deserialize(stream, name);
                        break;

                    case "XCMT":
                        XCMT = new ByteSubRecord();
                        XCMT.Deserialize(stream, name);
                        break;

                    case "XOWN":
                        XOWN = new UInt32SubRecord();
                        XOWN.Deserialize(stream, name);
                        break;

                    case "XGLB":
                        XGLB = new UInt32SubRecord();
                        XGLB.Deserialize(stream, name);
                        break;

                    case "XRNK":
                        XRNK = new UInt32SubRecord();
                        XRNK.Deserialize(stream, name);
                        break;

                    case "XCCM":
                        XCCM = new UInt32SubRecord();
                        XCCM.Deserialize(stream, name);
                        break;

                    case "XCWT":
                        XCWT = new UInt32SubRecord();
                        XCWT.Deserialize(stream, name);
                        break;

                    case "XCLW":
                        XCLW = new FloatSubRecord();
                        XCLW.Deserialize(stream, name);
                        break;

                    case "XCLR":
                        XCLR = new UInt32SubRecord();
                        XCLR.Deserialize(stream, name);
                        break;

                    case "XCLC":
                        XCLC = new Vector2iSubRecord();
                        XCLC.Deserialize(stream, name);
                        break;

                    default:
                        var rest = stream.ReadUInt16();
                        stream.ReadBytes(rest);
                        break;
                    }
                }
            }
        }