コード例 #1
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("MSceneObject");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (ID == null)
         {
             throw new TProtocolException(TProtocolException.INVALID_DATA, "required field ID not set");
         }
         field.Name = "ID";
         field.Type = TType.String;
         field.ID   = 1;
         oprot.WriteFieldBegin(field);
         oprot.WriteString(ID);
         oprot.WriteFieldEnd();
         if (Name == null)
         {
             throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Name not set");
         }
         field.Name = "Name";
         field.Type = TType.String;
         field.ID   = 2;
         oprot.WriteFieldBegin(field);
         oprot.WriteString(Name);
         oprot.WriteFieldEnd();
         if (Transform == null)
         {
             throw new TProtocolException(TProtocolException.INVALID_DATA, "required field Transform not set");
         }
         field.Name = "Transform";
         field.Type = TType.Struct;
         field.ID   = 3;
         oprot.WriteFieldBegin(field);
         Transform.Write(oprot);
         oprot.WriteFieldEnd();
         if (Collider != null && __isset.Collider)
         {
             field.Name = "Collider";
             field.Type = TType.Struct;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             Collider.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Mesh != null && __isset.Mesh)
         {
             field.Name = "Mesh";
             field.Type = TType.Struct;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             Mesh.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (PhysicsProperties != null && __isset.PhysicsProperties)
         {
             field.Name = "PhysicsProperties";
             field.Type = TType.Struct;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             PhysicsProperties.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Properties != null && __isset.Properties)
         {
             field.Name = "Properties";
             field.Type = TType.Map;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteMapBegin(new TMap(TType.String, TType.String, Properties.Count));
                 foreach (string _iter123 in Properties.Keys)
                 {
                     oprot.WriteString(_iter123);
                     oprot.WriteString(Properties[_iter123]);
                 }
                 oprot.WriteMapEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (Attachments != null && __isset.Attachments)
         {
             field.Name = "Attachments";
             field.Type = TType.List;
             field.ID   = 9;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, Attachments.Count));
                 foreach (MAttachment _iter124 in Attachments)
                 {
                     _iter124.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (Constraints != null && __isset.Constraints)
         {
             field.Name = "Constraints";
             field.Type = TType.List;
             field.ID   = 10;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, Constraints.Count));
                 foreach (MMIStandard.MConstraint _iter125 in Constraints)
                 {
                     _iter125.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }
コード例 #2
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("MSceneObjectUpdate");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (ID == null)
         {
             throw new TProtocolException(TProtocolException.INVALID_DATA, "required field ID not set");
         }
         field.Name = "ID";
         field.Type = TType.String;
         field.ID   = 1;
         oprot.WriteFieldBegin(field);
         oprot.WriteString(ID);
         oprot.WriteFieldEnd();
         if (Name != null && __isset.Name)
         {
             field.Name = "Name";
             field.Type = TType.String;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             oprot.WriteString(Name);
             oprot.WriteFieldEnd();
         }
         if (Transform != null && __isset.Transform)
         {
             field.Name = "Transform";
             field.Type = TType.Struct;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             Transform.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Collider != null && __isset.Collider)
         {
             field.Name = "Collider";
             field.Type = TType.Struct;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             Collider.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (Mesh != null && __isset.Mesh)
         {
             field.Name = "Mesh";
             field.Type = TType.Struct;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             Mesh.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (PhysicsProperties != null && __isset.PhysicsProperties)
         {
             field.Name = "PhysicsProperties";
             field.Type = TType.Struct;
             field.ID   = 6;
             oprot.WriteFieldBegin(field);
             PhysicsProperties.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (HandPoses != null && __isset.HandPoses)
         {
             field.Name = "HandPoses";
             field.Type = TType.List;
             field.ID   = 7;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, HandPoses.Count));
                 foreach (MMIStandard.MHandPose _iter138 in HandPoses)
                 {
                     _iter138.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (Properties != null && __isset.Properties)
         {
             field.Name = "Properties";
             field.Type = TType.List;
             field.ID   = 8;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, Properties.Count));
                 foreach (MPropertyUpdate _iter139 in Properties)
                 {
                     _iter139.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (Attachments != null && __isset.Attachments)
         {
             field.Name = "Attachments";
             field.Type = TType.List;
             field.ID   = 9;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, Attachments.Count));
                 foreach (MAttachment _iter140 in Attachments)
                 {
                     _iter140.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         if (Constraints != null && __isset.Constraints)
         {
             field.Name = "Constraints";
             field.Type = TType.List;
             field.ID   = 10;
             oprot.WriteFieldBegin(field);
             {
                 oprot.WriteListBegin(new TList(TType.Struct, Constraints.Count));
                 foreach (MMIStandard.MConstraint _iter141 in Constraints)
                 {
                     _iter141.Write(oprot);
                 }
                 oprot.WriteListEnd();
             }
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }