Пример #1
0
        public void MergeFrom(pb::CodedInputStream input)
        {
            uint tag;

            while ((tag = input.ReadTag()) != 0)
            {
                switch (tag)
                {
                default:
                    input.SkipLastField();
                    break;

                case 8: {
                    a_ = input.ReadInt32();
                    break;
                }

                case 18: {
                    if (b_ == null)
                    {
                        b_ = new global::Com.Zynga.Runtime.Protobuf.ChildMessage();
                        b_.SetParent(Context, 2);
                    }
                    input.ReadMessage(b_);
                    break;
                }
                }
            }
        }
Пример #2
0
 public void MergeFrom(ParentMessage other)
 {
     if (other == null)
     {
         return;
     }
     if (other.A != 0)
     {
         A = other.A;
     }
     if (other.b_ != null)
     {
         if (b_ == null)
         {
             b_ = new global::Com.Zynga.Runtime.Protobuf.ChildMessage();
         }
         B.MergeFrom(other.B);
     }
 }
Пример #3
0
        public override bool ApplyEvent(zpr.EventSource.EventData e, int pathIndex)
        {
            if (e.Path.Count == 0)
            {
                this.MergeFrom(e.Set.ByteData);
                return(true);
            }
            switch (e.Path[pathIndex])
            {
            case 1: {
                a_ = e.Set.I32;
            }
            break;

            case 2: {
                if (e.Path.Count - 1 != pathIndex)
                {
                    if (b_ == null)
                    {
                        b_ = new global::Com.Zynga.Runtime.Protobuf.ChildMessage();
                        b_.SetParent(Context, 2);
                    }
                    (b_ as zpr::IEventRegistry)?.ApplyEvent(e, pathIndex + 1);
                }
                else
                {
                    b_ = global::Com.Zynga.Runtime.Protobuf.ChildMessage.Parser.ParseFrom(e.Set.ByteData);
                    b_.SetParent(Context, 2);
                }
            }
            break;

            default:
                return(false);

                break;
            }
            return(true);
        }