コード例 #1
0
        public void Add(AmtEncodingInstruction inst)
        {
            var currentIndex = (uint)mInstructions.Count;

            mInstructions.Add(new AmtRecordInstruction
            {
                Index     = inst.Index,
                Operation = inst.Operation,
            });

            if (mCurrentContext == null)
            {
                InitializeNewContext(inst, currentIndex);
            }
            else
            {
                if (mCurrentContext.Category == inst.Category)
                {
                    mCurrentContext.Last = currentIndex;
                }
                else
                {
                    InitializeNewContext(inst, currentIndex);
                }
            }
        }
コード例 #2
0
 void InitializeNewContext(AmtEncodingInstruction inst, uint currentIndex)
 {
     mCurrentContext = new AmtEncoderContext
     {
         Category = inst.Category,
         First    = currentIndex,
         Last     = currentIndex,
     };
     mContexts.Add(mCurrentContext);
 }