Exemple #1
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("StructBattleCommand");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (__isset.side)
         {
             field.Name = "side";
             field.Type = TType.Byte;
             field.ID   = 10;
             oprot.WriteFieldBegin(field);
             oprot.WriteByte(Side);
             oprot.WriteFieldEnd();
         }
         if (__isset.type)
         {
             field.Name = "type";
             field.Type = TType.I32;
             field.ID   = 20;
             oprot.WriteFieldBegin(field);
             oprot.WriteI32(Type);
             oprot.WriteFieldEnd();
         }
         if (FireBall != null && __isset.fireBall)
         {
             field.Name = "fireBall";
             field.Type = TType.Struct;
             field.ID   = 30;
             oprot.WriteFieldBegin(field);
             FireBall.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (FireBallResponse != null && __isset.fireBallResponse)
         {
             field.Name = "fireBallResponse";
             field.Type = TType.Struct;
             field.ID   = 40;
             oprot.WriteFieldBegin(field);
             FireBallResponse.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (EraseBall != null && __isset.eraseBall)
         {
             field.Name = "eraseBall";
             field.Type = TType.Struct;
             field.ID   = 50;
             oprot.WriteFieldBegin(field);
             EraseBall.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (FallBall != null && __isset.fallBall)
         {
             field.Name = "fallBall";
             field.Type = TType.Struct;
             field.ID   = 60;
             oprot.WriteFieldBegin(field);
             FallBall.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (BallQueue != null && __isset.ballQueue)
         {
             field.Name = "ballQueue";
             field.Type = TType.Struct;
             field.ID   = 70;
             oprot.WriteFieldBegin(field);
             BallQueue.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (SceneTransform != null && __isset.sceneTransform)
         {
             field.Name = "sceneTransform";
             field.Type = TType.Struct;
             field.ID   = 80;
             oprot.WriteFieldBegin(field);
             SceneTransform.Write(oprot);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }
Exemple #2
0
        public override string ToString()
        {
            StringBuilder __sb    = new StringBuilder("StructBattleCommand(");
            bool          __first = true;

            if (__isset.side)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Side: ");
                __sb.Append(Side);
            }
            if (__isset.type)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("Type: ");
                __sb.Append(Type);
            }
            if (FireBall != null && __isset.fireBall)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("FireBall: ");
                __sb.Append(FireBall == null ? "<null>" : FireBall.ToString());
            }
            if (FireBallResponse != null && __isset.fireBallResponse)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("FireBallResponse: ");
                __sb.Append(FireBallResponse == null ? "<null>" : FireBallResponse.ToString());
            }
            if (EraseBall != null && __isset.eraseBall)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("EraseBall: ");
                __sb.Append(EraseBall == null ? "<null>" : EraseBall.ToString());
            }
            if (FallBall != null && __isset.fallBall)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("FallBall: ");
                __sb.Append(FallBall == null ? "<null>" : FallBall.ToString());
            }
            if (BallQueue != null && __isset.ballQueue)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("BallQueue: ");
                __sb.Append(BallQueue == null ? "<null>" : BallQueue.ToString());
            }
            if (SceneTransform != null && __isset.sceneTransform)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("SceneTransform: ");
                __sb.Append(SceneTransform == null ? "<null>" : SceneTransform.ToString());
            }
            __sb.Append(")");
            return(__sb.ToString());
        }
Exemple #3
0
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                TField field;
                iprot.ReadStructBegin();
                while (true)
                {
                    field = iprot.ReadFieldBegin();
                    if (field.Type == TType.Stop)
                    {
                        break;
                    }
                    switch (field.ID)
                    {
                    case 10:
                        if (field.Type == TType.Byte)
                        {
                            Side = iprot.ReadByte();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 20:
                        if (field.Type == TType.I32)
                        {
                            Type = iprot.ReadI32();
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 30:
                        if (field.Type == TType.Struct)
                        {
                            FireBall = new FireBall();
                            FireBall.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 40:
                        if (field.Type == TType.Struct)
                        {
                            FireBallResponse = new FireBallResponse();
                            FireBallResponse.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 50:
                        if (field.Type == TType.Struct)
                        {
                            EraseBall = new EraseBall();
                            EraseBall.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 60:
                        if (field.Type == TType.Struct)
                        {
                            FallBall = new FallBall();
                            FallBall.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 70:
                        if (field.Type == TType.Struct)
                        {
                            BallQueue = new BallQueue();
                            BallQueue.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 80:
                        if (field.Type == TType.Struct)
                        {
                            SceneTransform = new SceneTransform();
                            SceneTransform.Read(iprot);
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }