Пример #1
0
        // Token: 0x06003B3F RID: 15167 RVA: 0x0010F144 File Offset: 0x0010D344
        public static BusinessCard FromProtocol(ProBusinessCard pbBusinessCard)
        {
            BusinessCard businessCard = new BusinessCard();

            businessCard.UserId          = pbBusinessCard.UserId;
            businessCard.HeadIcon        = pbBusinessCard.HeadIcon;
            businessCard.Name            = pbBusinessCard.Name;
            businessCard.Level           = pbBusinessCard.Level;
            businessCard.ArenaPoints     = pbBusinessCard.ArenaPoints;
            businessCard.Likes           = pbBusinessCard.Likes;
            businessCard.IsOnLine        = pbBusinessCard.IsOnLine;
            businessCard.SetInfo         = BusinessCardInfoSet.FromProtocol(pbBusinessCard.SetInfo);
            businessCard.StatisticalData = BusinessCardStatisticalData.FromProtocol(pbBusinessCard.StatisticalData);
            foreach (ProBattleHero pbBattleHero in pbBusinessCard.Heroes)
            {
                businessCard.Heroes.Add(BattleHero.PBBattleHeroToBattleHero(pbBattleHero));
            }
            foreach (ProBattleHero pbBattleHero2 in pbBusinessCard.MostSkilledHeroes)
            {
                businessCard.MostSkilledHeroes.Add(BattleHero.PBBattleHeroToBattleHero(pbBattleHero2));
            }
            foreach (ProTrainingTech tech in pbBusinessCard.Techs)
            {
                businessCard.Techs.Add(TrainingTech.FromDataSection(tech));
            }
            return(businessCard);
        }
Пример #2
0
 // Token: 0x060031D6 RID: 12758 RVA: 0x000C4320 File Offset: 0x000C2520
 public static BattleHeroSetupInfo PbBattleHeroSetupInfoToProBattleHeroSetupInfo(ProBattleHeroSetupInfo pbInfo)
 {
     return(new BattleHeroSetupInfo
     {
         PlayerIndex = pbInfo.PlayerIndex,
         Position = pbInfo.Position,
         Hero = ((pbInfo.Hero == null) ? null : BattleHero.PBBattleHeroToBattleHero(pbInfo.Hero)),
         Flag = (SetupBattleHeroFlag)pbInfo.Flag
     });
 }
Пример #3
0
        // Token: 0x06004E1D RID: 19997 RVA: 0x0017BE64 File Offset: 0x0017A064
        public static ArenaBattleReport PBArenaBattleReportToArenaBattleReport(ProArenaBattleReport pbArenaBattleReport, bool isBattleData)
        {
            ArenaBattleReport arenaBattleReport = new ArenaBattleReport();

            arenaBattleReport.InstanceId = pbArenaBattleReport.InstanceId;
            arenaBattleReport.Version    = pbArenaBattleReport.Version;
            if (isBattleData)
            {
                arenaBattleReport.BattleType          = (BattleType)pbArenaBattleReport.BattleType;
                arenaBattleReport.BattleId            = pbArenaBattleReport.BattleId;
                arenaBattleReport.RandomSeed          = pbArenaBattleReport.RandomSeed;
                arenaBattleReport.ArenaDefenderRuleId = pbArenaBattleReport.ArenaDefenderRuleId;
                foreach (ProBattleCommand pbBattleCommand in pbArenaBattleReport.Commands)
                {
                    arenaBattleReport.Commands.Add(BattleCommand.PBBattleCommandToBattleCommand(pbBattleCommand));
                }
                foreach (ProBattleHero pbBattleHero in pbArenaBattleReport.AttackerHeroes)
                {
                    arenaBattleReport.AttackerHeroes.Add(BattleHero.PBBattleHeroToBattleHero(pbBattleHero));
                }
                foreach (ProBattleHero pbBattleHero2 in pbArenaBattleReport.DefenderHeroes)
                {
                    arenaBattleReport.DefenderHeroes.Add(BattleHero.PBBattleHeroToBattleHero(pbBattleHero2));
                }
                foreach (ProTrainingTech tech in pbArenaBattleReport.AttackerTechs)
                {
                    arenaBattleReport.AttackerTechs.Add(TrainingTech.FromDataSection(tech));
                }
                foreach (ProTrainingTech tech2 in pbArenaBattleReport.DefenderTechs)
                {
                    arenaBattleReport.DefenderTechs.Add(TrainingTech.FromDataSection(tech2));
                }
            }
            else
            {
                arenaBattleReport.Status                 = (ArenaBattleReportStatus)pbArenaBattleReport.Status;
                arenaBattleReport.AttackerUserId         = pbArenaBattleReport.AttackerUserId;
                arenaBattleReport.AttackerLevel          = pbArenaBattleReport.AttackerLevel;
                arenaBattleReport.AttackerName           = pbArenaBattleReport.AttackerName;
                arenaBattleReport.DefenderUserId         = pbArenaBattleReport.DefenderUserId;
                arenaBattleReport.DefenderLevel          = pbArenaBattleReport.DefenderLevel;
                arenaBattleReport.DefenderName           = pbArenaBattleReport.DefenderName;
                arenaBattleReport.CreateTime             = pbArenaBattleReport.CreateTime;
                arenaBattleReport.AttackerGotArenaPoints = pbArenaBattleReport.AttackerGotArenaPoints;
                arenaBattleReport.DefenderGotArenaPoints = pbArenaBattleReport.DefenderGotArenaPoints;
                arenaBattleReport.OpponentHeadIcon       = pbArenaBattleReport.OpponentHeadIcon;
            }
            return(arenaBattleReport);
        }
        // Token: 0x0600510B RID: 20747 RVA: 0x00182480 File Offset: 0x00180680
        public static RealTimePVPBattleReportPlayerData ToMemory(this ProRealTimePVPBattleReportPlayerData Data)
        {
            RealTimePVPBattleReportPlayerData realTimePVPBattleReportPlayerData = new RealTimePVPBattleReportPlayerData
            {
                HeadIcon  = Data.HeadIcon,
                Level     = Data.Level,
                Name      = Data.Name,
                UserId    = Data.UserId,
                ScoreDiff = Data.ScoreDiff
            };

            foreach (ProBattleHero pbBattleHero in Data.Heroes)
            {
                realTimePVPBattleReportPlayerData.Heroes.Add(BattleHero.PBBattleHeroToBattleHero(pbBattleHero));
            }
            foreach (ProTrainingTech tech in Data.Techs)
            {
                realTimePVPBattleReportPlayerData.Techs.Add(TrainingTech.FromDataSection(tech));
            }
            return(realTimePVPBattleReportPlayerData);
        }
        // Token: 0x06004DE0 RID: 19936 RVA: 0x0017B6C4 File Offset: 0x001798C4
        public static ArenaOpponentDefensiveBattleInfo PBDefensiveBattleInfoToDefensiveBattleInfo(ProArenaDefensiveBattleInfo pbDefensiveBattleInfo)
        {
            ArenaOpponentDefensiveBattleInfo arenaOpponentDefensiveBattleInfo = new ArenaOpponentDefensiveBattleInfo();

            arenaOpponentDefensiveBattleInfo.BattleExpiredTime                      = pbDefensiveBattleInfo.BattleExpiredTime;
            arenaOpponentDefensiveBattleInfo.BattleRandomSeed                       = pbDefensiveBattleInfo.RandomSeed;
            arenaOpponentDefensiveBattleInfo.BattleTeamSnapshot.BattleId            = pbDefensiveBattleInfo.BattleId;
            arenaOpponentDefensiveBattleInfo.BattleTeamSnapshot.ArenaDefenderRuleId = pbDefensiveBattleInfo.ArenaDefenderRuleId;
            arenaOpponentDefensiveBattleInfo.ArenaOpponentPointZoneId               = pbDefensiveBattleInfo.ArenaOpponentPointZoneId;
            arenaOpponentDefensiveBattleInfo.BattleTeamSnapshot.PlayerLevel         = pbDefensiveBattleInfo.PlayerLevel;
            foreach (ProBattleHero pbBattleHero in pbDefensiveBattleInfo.DefenderHeroes)
            {
                arenaOpponentDefensiveBattleInfo.BattleTeamSnapshot.DefenderHeroes.Add(BattleHero.PBBattleHeroToBattleHero(pbBattleHero));
            }
            foreach (ProTrainingTech tech in pbDefensiveBattleInfo.Techs)
            {
                arenaOpponentDefensiveBattleInfo.BattleTeamSnapshot.Techs.Add(TrainingTech.FromDataSection(tech));
            }
            return(arenaOpponentDefensiveBattleInfo);
        }