Ejemplo n.º 1
0
        // Remote battle
        internal PBETeam(PBEBattle battle, PBEBattlePacket.PBETeamInfo info, List <PBETrainer> allTrainers)
        {
            ReadOnlyCollection <PBEBattlePacket.PBETeamInfo.PBETrainerInfo> ti = info.Trainers;
            int count = ti.Count;

            if (!VerifyTrainerCount(battle.BattleFormat, count))
            {
                throw new InvalidDataException();
            }
            Battle = battle;
            Id     = info.Id;
            var trainers = new PBETrainer[ti.Count];

            for (int i = 0; i < trainers.Length; i++)
            {
                trainers[i] = new PBETrainer(this, ti[i], allTrainers);
            }
            Trainers = new ReadOnlyCollection <PBETrainer>(trainers);
        }
Ejemplo n.º 2
0
        // Remote battle
        internal PBETeam(PBEBattle battle, PBEBattlePacket.PBETeamInfo info, List <PBETrainer> allTrainers)
        {
            ReadOnlyCollection <PBEBattlePacket.PBETeamInfo.PBETrainerInfo> ti = info.Trainers;
            int count = ti.Count;

            if (!VerifyTrainerCount(battle.BattleFormat, count))
            {
                throw new InvalidDataException();
            }
            Battle = battle;
            Id     = info.Id;
            var trainers = new PBETrainer[ti.Count];

            for (int i = 0; i < trainers.Length; i++)
            {
                trainers[i] = new PBETrainer(this, ti[i], allTrainers);
            }
            Trainers     = new ReadOnlyCollection <PBETrainer>(trainers);
            CombinedName = GetCombinedName();
            OpposingTeam = null !; // OpposingTeam is set in PBETeams after both are created
        }