Esempio n. 1
0
        protected override Stream UnParse()
        {
            var outputStream = new MemoryStream();
            var s            = new BinaryStreamWrapper(outputStream, ByteOrder.BigEndian);

            s.Write(mVersion);
            if (mEffectSections == null)
            {
                mEffectSections = new EffectSectionList(OnResourceChanged);
            }
            mEffectSections.UnParse(outputStream);
            if (mResourceSections == null)
            {
                mResourceSections = new ResourceSectionList(OnResourceChanged);
            }
            mResourceSections.UnParse(outputStream);
            if (mVisualEffectSections == null)
            {
                mVisualEffectSections = new VisualEffectSection(0, OnResourceChanged, 2);
            }
            s.Write(mVisualEffectSections.Version);
            mVisualEffectSections.UnParse(outputStream);
            if (mVisualEffectIds == null)
            {
                mVisualEffectIds = new VisualEffectIdList(OnResourceChanged);
            }
            mVisualEffectIds.UnParse(outputStream);
            if (mVisualEffectNames == null)
            {
                mVisualEffectNames = new VisualEffectNameList(OnResourceChanged);
            }
            mVisualEffectNames.UnParse(outputStream);
            return(outputStream);
        }
Esempio n. 2
0
        public void Parse(Stream inputStream)
        {
            var s = new BinaryStreamWrapper(inputStream, ByteOrder.BigEndian);

            mVersion              = s.ReadUInt16();
            mEffectSections       = new EffectSectionList(OnResourceChanged, inputStream);
            mResourceSections     = new ResourceSectionList(OnResourceChanged, inputStream);
            mVisualEffectSections = new VisualEffectSection(0, OnResourceChanged, s.ReadUInt16(), inputStream);
            mVisualEffectIds      = new VisualEffectIdList(OnResourceChanged, inputStream);
            mVisualEffectNames    = new VisualEffectNameList(OnResourceChanged, inputStream);
        }