コード例 #1
0
        public override void ReadData(ESPReader reader, long dataEnd)
        {
            while (reader.BaseStream.Position < dataEnd)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EDID":
                    if (EditorID == null)
                    {
                        EditorID = new SimpleSubrecord <String>();
                    }

                    EditorID.ReadBinary(reader);
                    break;

                case "OBND":
                    if (ObjectBounds == null)
                    {
                        ObjectBounds = new ObjectBounds();
                    }

                    ObjectBounds.ReadBinary(reader);
                    break;

                case "MODL":
                    if (Model == null)
                    {
                        Model = new Model();
                    }

                    Model.ReadBinary(reader);
                    break;

                case "DATA":
                    if (NodeIndex == null)
                    {
                        NodeIndex = new SimpleSubrecord <Int32>();
                    }

                    NodeIndex.ReadBinary(reader);
                    break;

                case "SNAM":
                    if (Sound == null)
                    {
                        Sound = new RecordReference();
                    }

                    Sound.ReadBinary(reader);
                    break;

                case "DNAM":
                    if (Data == null)
                    {
                        Data = new AddonNodeData();
                    }

                    Data.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }