Ejemplo n.º 1
0
 public WeihuaGames.ClientClass.ZentiaExchange FromProtobuf(com.kodgames.corgi.protocol.ZentiaExchange zentiaExchange)
 {
     if (zentiaExchange != null)
     {
         this.exchangeId         = zentiaExchange.exchangeId;
         this.index              = zentiaExchange.index;
         this.iconId             = zentiaExchange.iconId;
         this.isAlreadyExchanged = zentiaExchange.isAlreadyExchanged;
         if (zentiaExchange.costs != null)
         {
             List <WeihuaGames.ClientClass.ItemEx> list = new List <WeihuaGames.ClientClass.ItemEx>();
             foreach (com.kodgames.corgi.protocol.ItemEx ex in zentiaExchange.costs)
             {
                 if (ex != null)
                 {
                     WeihuaGames.ClientClass.ItemEx item = new WeihuaGames.ClientClass.ItemEx();
                     item.FromProtobuf(ex);
                     list.Add(item);
                 }
             }
             this.costs = list;
         }
         if (zentiaExchange.costAssets != null)
         {
             List <WeihuaGames.ClientClass.CostAsset> list2 = new List <WeihuaGames.ClientClass.CostAsset>();
             foreach (com.kodgames.corgi.protocol.CostAsset asset in zentiaExchange.costAssets)
             {
                 if (asset != null)
                 {
                     WeihuaGames.ClientClass.CostAsset asset2 = new WeihuaGames.ClientClass.CostAsset();
                     asset2.FromProtobuf(asset);
                     list2.Add(asset2);
                 }
             }
             this.costAssets = list2;
         }
         if (zentiaExchange.reward != null)
         {
             WeihuaGames.ClientClass.Reward reward = new WeihuaGames.ClientClass.Reward();
             reward.FromProtobuf(zentiaExchange.reward);
             this.reward = reward;
         }
         if (zentiaExchange.zentiaReward != null)
         {
             WeihuaGames.ClientClass.Reward reward2 = new WeihuaGames.ClientClass.Reward();
             reward2.FromProtobuf(zentiaExchange.zentiaReward);
             this.zentiaReward = reward2;
         }
     }
     return(this);
 }
Ejemplo n.º 2
0
 public WeihuaGames.ClientClass.ConstructionTask FromProtobuf(com.kodgames.corgi.protocol.ConstructionTask constructionTask)
 {
     if (constructionTask != null)
     {
         this.taskId      = constructionTask.taskId;
         this.taskIndex   = constructionTask.taskIndex;
         this.isDoing     = constructionTask.isDoing;
         this.taskName    = constructionTask.taskName;
         this.taskQuality = constructionTask.taskQuality;
         this.taskIconId  = constructionTask.taskIconId;
         this.taskDesc    = constructionTask.taskDesc;
         this.color       = constructionTask.color;
         if (constructionTask.oneClickCompletedCosts != null)
         {
             List <WeihuaGames.ClientClass.Cost> list = new List <WeihuaGames.ClientClass.Cost>();
             foreach (com.kodgames.corgi.protocol.Cost cost in constructionTask.oneClickCompletedCosts)
             {
                 list.Add(new WeihuaGames.ClientClass.Cost().FromProtobuf(cost));
             }
             this.oneClickCompletedCosts = list;
         }
         if (constructionTask.costs != null)
         {
             WeihuaGames.ClientClass.ItemEx ex = new WeihuaGames.ClientClass.ItemEx();
             ex.FromProtobuf(constructionTask.costs);
             this.costs = ex;
         }
         if (constructionTask.costAssets != null)
         {
             WeihuaGames.ClientClass.CostAsset asset = new WeihuaGames.ClientClass.CostAsset();
             asset.FromProtobuf(constructionTask.costAssets);
             this.costAssets = asset;
         }
         if (constructionTask.reward != null)
         {
             List <WeihuaGames.ClientClass.RewardView> list2 = new List <WeihuaGames.ClientClass.RewardView>();
             foreach (com.kodgames.corgi.protocol.RewardView view in constructionTask.reward)
             {
                 list2.Add(new WeihuaGames.ClientClass.RewardView().FromProtobuf(view));
             }
             this.reward = list2;
         }
         this.guildConstruct     = constructionTask.guildConstruct;
         this.playerContribution = constructionTask.playerContribution;
     }
     return(this);
 }
Ejemplo n.º 3
0
 public void FromProtobuf(com.kodgames.corgi.protocol.Exchange exchange)
 {
     this.exchangeId           = exchange.exchangeId;
     this.vipLevel             = exchange.vipLevel;
     this.exchangeCount        = exchange.exchangeCount;
     this.alreadyExchangeCount = exchange.alreadyExchangeCount;
     this.openTime             = exchange.openTime;
     this.endTime      = exchange.endTime;
     this.nextOpenTime = exchange.nextOpenTime;
     if (exchange.gainItem != null)
     {
         this.gainItem = new WeihuaGames.ClientClass.ItemEx();
         this.gainItem.FromProtobuf(exchange.gainItem);
     }
     this.playerLevel     = exchange.playerLevel;
     this.groupId         = exchange.groupId;
     this.nextRefreshTime = exchange.nextRefreshTime;
     if (exchange.costs != null)
     {
         this.costs = new List <WeihuaGames.ClientClass.ItemEx>();
         foreach (com.kodgames.corgi.protocol.ItemEx ex in exchange.costs)
         {
             if (ex != null)
             {
                 WeihuaGames.ClientClass.ItemEx item = new WeihuaGames.ClientClass.ItemEx();
                 item.FromProtobuf(ex);
                 this.costs.Add(item);
             }
         }
     }
     if (exchange.costAssets != null)
     {
         this.costAssets = new List <WeihuaGames.ClientClass.CostAsset>();
         foreach (com.kodgames.corgi.protocol.CostAsset asset in exchange.costAssets)
         {
             if (asset != null)
             {
                 WeihuaGames.ClientClass.CostAsset asset2 = new WeihuaGames.ClientClass.CostAsset();
                 asset2.FromProtobuf(asset);
                 this.costAssets.Add(asset2);
             }
         }
     }
 }