public Thrift.Protocol.TBase Convert(Character.AbstractBusinessObject o)
        {
            if (null == o)
            {
                return null;
            }
            CharCounterData data = o as CharCounterData;
            CharCounterInfo info = new CharCounterInfo();
            info.CharId = data.CharId;
            if (null != data.Bit32CounterList)
            {
                info.Bit32CounterList = new List<int>(data.Bit32CounterList);
            }            
            if(null != data.Bit8CounterList)
            {
                info.Bit8CounterList = new List<sbyte>(data.Bit8CounterList);
            }
            if(null != data.FlagList)
            {
                info.FlagList = new List<bool>(data.FlagList);
            }
            

            return info;
        }
 public override string ToString() {
   StringBuilder sb = new StringBuilder("SyncCharDataRequest(");
   sb.Append("CharBaseInfo: ");
   sb.Append(CharBaseInfo== null ? "<null>" : CharBaseInfo.ToString());
   sb.Append(",CharCounterInfo: ");
   sb.Append(CharCounterInfo== null ? "<null>" : CharCounterInfo.ToString());
   sb.Append(",CharBagInfo: ");
   sb.Append(CharBagInfo== null ? "<null>" : CharBagInfo.ToString());
   sb.Append(",CharMissionInfo: ");
   sb.Append(CharMissionInfo== null ? "<null>" : CharMissionInfo.ToString());
   sb.Append(")");
   return sb.ToString();
 }
示例#3
0
        public void Write(TProtocol oprot)
        {
            TStruct struc = new TStruct("CharacterInfo");

            oprot.WriteStructBegin(struc);
            TField field = new TField();

            if (CharBaseInfo != null && __isset.charBaseInfo)
            {
                field.Name = "charBaseInfo";
                field.Type = TType.Struct;
                field.ID   = 10;
                oprot.WriteFieldBegin(field);
                CharBaseInfo.Write(oprot);
                oprot.WriteFieldEnd();
            }
            if (CharCounterInfo != null && __isset.charCounterInfo)
            {
                field.Name = "charCounterInfo";
                field.Type = TType.Struct;
                field.ID   = 20;
                oprot.WriteFieldBegin(field);
                CharCounterInfo.Write(oprot);
                oprot.WriteFieldEnd();
            }
            if (CharBagInfo != null && __isset.charBagInfo)
            {
                field.Name = "charBagInfo";
                field.Type = TType.Struct;
                field.ID   = 30;
                oprot.WriteFieldBegin(field);
                CharBagInfo.Write(oprot);
                oprot.WriteFieldEnd();
            }
            if (CharMissionInfo != null && __isset.charMissionInfo)
            {
                field.Name = "charMissionInfo";
                field.Type = TType.Struct;
                field.ID   = 40;
                oprot.WriteFieldBegin(field);
                CharMissionInfo.Write(oprot);
                oprot.WriteFieldEnd();
            }
            oprot.WriteFieldStop();
            oprot.WriteStructEnd();
        }
示例#4
0
        public void Read(TProtocol iprot)
        {
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 10:
                    if (field.Type == TType.Struct)
                    {
                        CharBaseInfo = new CharBaseInfo();
                        CharBaseInfo.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

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

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

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