示例#1
0
 public WeihuaGames.ClientClass.WolfSmokeGoodsInfo FromProtobuf(com.kodgames.corgi.protocol.WolfSmokeGoodsInfo wolfSmokeGoodsInfo)
 {
     if (wolfSmokeGoodsInfo != null)
     {
         this.goodsId    = wolfSmokeGoodsInfo.goodsId;
         this.alreadyBuy = wolfSmokeGoodsInfo.alreadyBuy;
         if (wolfSmokeGoodsInfo.reward != null)
         {
             WeihuaGames.ClientClass.Consumable consumable = new WeihuaGames.ClientClass.Consumable();
             consumable.FromProtobuf(wolfSmokeGoodsInfo.reward);
             this.reward = consumable;
         }
         if (wolfSmokeGoodsInfo.cost != null)
         {
             WeihuaGames.ClientClass.Cost cost = new WeihuaGames.ClientClass.Cost();
             cost.FromProtobuf(wolfSmokeGoodsInfo.cost);
             this.cost = cost;
         }
         if (wolfSmokeGoodsInfo.discountCost != null)
         {
             WeihuaGames.ClientClass.Cost cost2 = new WeihuaGames.ClientClass.Cost();
             cost2.FromProtobuf(wolfSmokeGoodsInfo.discountCost);
             this.discountCost = cost2;
         }
         this.goodsIndex = wolfSmokeGoodsInfo.goodsIndex;
     }
     return(this);
 }
示例#2
0
 public WeihuaGames.ClientClass.Consumable AddConsumable(int id, int count)
 {
     WeihuaGames.ClientClass.Consumable item = this.SearchConsumable(id);
     if (item == null)
     {
         item = new WeihuaGames.ClientClass.Consumable {
             Id     = id,
             Amount = 0
         };
         this.consumables.Add(item);
     }
     item.Amount += count;
     return(item);
 }
示例#3
0
 public WeihuaGames.ClientClass.Consumable RemoveConsumable(int id, int count)
 {
     WeihuaGames.ClientClass.Consumable item = this.SearchConsumable(id);
     if (item == null)
     {
         return(null);
     }
     item.Amount -= count;
     if (item.Amount <= 0)
     {
         this.consumables.Remove(item);
     }
     return(item);
 }
示例#4
0
 public WeihuaGames.ClientClass.Reward FromProtobuf(com.kodgames.corgi.protocol.Reward reward)
 {
     if (reward != null)
     {
         this.isBeastDecomposed = reward.isBeastDecomposed;
         foreach (com.kodgames.corgi.protocol.Equipment equipment in reward.equips)
         {
             WeihuaGames.ClientClass.Equipment item = new WeihuaGames.ClientClass.Equipment();
             item.FromProtobuf(equipment);
             this.equip.Add(item);
         }
         foreach (com.kodgames.corgi.protocol.Avatar avatar in reward.avatars)
         {
             WeihuaGames.ClientClass.Avatar avatar2 = new WeihuaGames.ClientClass.Avatar();
             avatar2.FromProtobuf(avatar);
             this.avatar.Add(avatar2);
         }
         foreach (com.kodgames.corgi.protocol.Skill skill in reward.skills)
         {
             WeihuaGames.ClientClass.Skill skill2 = new WeihuaGames.ClientClass.Skill();
             skill2.FromProtobuf(skill);
             this.skill.Add(skill2);
         }
         foreach (com.kodgames.corgi.protocol.Consumable consumable in reward.consumables)
         {
             WeihuaGames.ClientClass.Consumable consumable2 = new WeihuaGames.ClientClass.Consumable();
             consumable2.FromProtobuf(consumable);
             this.consumable.Add(consumable2);
         }
         foreach (com.kodgames.corgi.protocol.Consumable consumable3 in reward.hideConsumables)
         {
             WeihuaGames.ClientClass.Consumable consumable4 = new WeihuaGames.ClientClass.Consumable();
             consumable4.FromProtobuf(consumable3);
             this.hideConsumables.Add(consumable4);
         }
         foreach (com.kodgames.corgi.protocol.Dan dan in reward.dans)
         {
             WeihuaGames.ClientClass.Dan dan2 = new WeihuaGames.ClientClass.Dan();
             dan2.FromProtobuf(dan);
             this.dan.Add(dan2);
         }
         foreach (com.kodgames.corgi.protocol.Beast beast in reward.beasts)
         {
             WeihuaGames.ClientClass.Beast beast2 = new WeihuaGames.ClientClass.Beast();
             beast2.FromProtobuf(beast);
             this.beast.Add(beast2);
         }
     }
     return(this);
 }
示例#5
0
 public WeihuaGames.ClientClass.MysteryGoodInfo FromProtoBuf(com.kodgames.corgi.protocol.MysteryGoodInfo protoInfo)
 {
     if (protoInfo == null)
     {
         return(null);
     }
     this.goodId    = protoInfo.goodsId;
     this.goodIndex = protoInfo.goodsIndex;
     this.buyOrNot  = protoInfo.buyOrNot;
     this.consume   = new WeihuaGames.ClientClass.Consumable().FromProtobuf(protoInfo.reward);
     this.cost      = new WeihuaGames.ClientClass.Cost().FromProtobuf(protoInfo.cost);
     if (protoInfo.discountCost != null)
     {
         this.discountCost = new WeihuaGames.ClientClass.Cost().FromProtobuf(protoInfo.discountCost);
     }
     return(this);
 }
示例#6
0
 public WeihuaGames.ClientClass.Player FromProtobuf(com.kodgames.corgi.protocol.Player player)
 {
     this.levelAttrib       = new WeihuaGames.ClientClass.LevelAttrib();
     this.skills            = new List <WeihuaGames.ClientClass.Skill>();
     this.equipments        = new List <WeihuaGames.ClientClass.Equipment>();
     this.consumables       = new List <WeihuaGames.ClientClass.Consumable>();
     this.avatars           = new List <WeihuaGames.ClientClass.Avatar>();
     this.SignData          = new WeihuaGames.ClientClass.SignData();
     this.playerId          = player.playerId;
     this.name              = player.name;
     this.gameMoney         = player.gameMoney;
     this.realMoney         = player.realMoney;
     this.iron              = player.iron;
     this.spirit            = player.spirit;
     this.medals            = player.medals;
     this.wineSoul          = player.wineSoul;
     this.zentia            = player.zentia;
     this.guildMoney        = player.guildMoney;
     this.guildBossCount    = player.guildBossCount;
     this.power             = player.power;
     this.stamina.Point     = new TimerIncreaseValue(player.stamina, player.staminaLastCalculateTime);
     this.lastChatResetTime = player.lastResetChatTime;
     this.currentChatCount  = player.currentChatCount;
     this.chatData.UnreadPrivateChatMsgCount = player.unreadPrivateMsgCount;
     this.chatData.UnreadGuildChatCount      = player.guildUnreadChatCount;
     this.timeZone                    = player.timeZone;
     this.newCombatEmailCount         = player.newCombatEmailCount;
     this.newFriendEmailCount         = player.newFriendEmailCount;
     this.newSystemEmailCount         = player.newSystemEmailCount;
     this.newGuildEmailCount          = player.newGuildEmailCount;
     this.energy.Point                = new TimerIncreaseValue(player.energy, player.energyLastCalculateTime);
     this.energyBuyCount              = player.energyBuyCount;
     this.energyBuyCountLastResetTime = player.energyBuyCountLastResetTime;
     this.vipLevel                    = player.vipLevel;
     this.totalCostRMB                = player.totalCostRMB;
     this.remainingCostRMB            = player.remainningCostRMB;
     this.badge     = player.badge;
     this.loginTime = player.loginTime;
     if (player.levelAttrib != null)
     {
         this.levelAttrib.FromProtobuf(player.levelAttrib);
     }
     this.soul = player.soul;
     this.currentPickedLevel = player.curentPickedLevel;
     if (player.signData != null)
     {
         this.SignData.FromProtobuf(player.signData);
     }
     foreach (com.kodgames.corgi.protocol.Avatar avatar in player.avatars)
     {
         WeihuaGames.ClientClass.Avatar item = new WeihuaGames.ClientClass.Avatar();
         item.FromProtobuf(avatar);
         this.avatars.Add(item);
     }
     foreach (com.kodgames.corgi.protocol.Equipment equipment in player.equipments)
     {
         WeihuaGames.ClientClass.Equipment equipment2 = new WeihuaGames.ClientClass.Equipment();
         equipment2.FromProtobuf(equipment);
         this.equipments.Add(equipment2);
     }
     foreach (com.kodgames.corgi.protocol.Consumable consumable in player.consumables)
     {
         WeihuaGames.ClientClass.Consumable consumable2 = new WeihuaGames.ClientClass.Consumable();
         consumable2.FromProtobuf(consumable);
         this.consumables.Add(consumable2);
     }
     foreach (com.kodgames.corgi.protocol.Skill skill in player.skills)
     {
         WeihuaGames.ClientClass.Skill skill2 = new WeihuaGames.ClientClass.Skill();
         skill2.FromProtobuf(skill);
         this.skills.Add(skill2);
     }
     this.didCharge = player.didCharge;
     if (player.unDoneTutorialIds != null)
     {
         this.unDoneTutorials = player.unDoneTutorialIds;
     }
     this.staminaBuyCount = player.staminaBuyCount;
     this.staminaBuyCountLastResetTime = player.staminaBuyCountLastResetTime;
     this.trialStamp = player.trialStamp;
     this.threeToken = player.threeToken;
     if (player.questQuick != null)
     {
         this.questData.QuestQuick = new WeihuaGames.ClientClass.QuestQuick().FromProtoBuffer(player.questQuick);
     }
     if (player.startServerRewardInfo != null)
     {
         this.startServerRewardInfo = new WeihuaGames.ClientClass.StartServerRewardInfo().FromProtoBuf(player.startServerRewardInfo);
     }
     this.hasEvaluate         = player.hasEvaluate;
     this.cancelEvaluateLevel = player.cancelEvaluateLevel;
     if (player.hireDinerData != null)
     {
         this.hireDinerData.FromProtoBuf(player.hireDinerData);
     }
     this.qinInfoAnswerCount.Point = new TimerIncreaseValue(player.qinInfoAnswerCount, player.qinInfoAnswerCountRecoverTime);
     this.positionData.FromProtobuf(player.positionData);
     foreach (int num in player.appleGoodIds)
     {
         this.appleGoodIds.Add(num);
     }
     this.illusionData = new com.kodgames.corgi.protocol.IllusionData();
     if (player.illusionData != null)
     {
         this.illusionData = player.illusionData;
     }
     foreach (com.kodgames.corgi.protocol.Dan dan in player.dans)
     {
         WeihuaGames.ClientClass.Dan dan2 = new WeihuaGames.ClientClass.Dan();
         dan2.FromProtobuf(dan);
         this.dans.Add(dan2);
     }
     foreach (com.kodgames.corgi.protocol.Beast beast in player.beasts)
     {
         WeihuaGames.ClientClass.Beast beast2 = new WeihuaGames.ClientClass.Beast();
         beast2.FromProtobuf(beast);
         this.beasts.Add(beast2);
     }
     return(this);
 }