Ejemplo n.º 1
0
        // Wild battle
        internal PBETeams(PBEBattle battle, IReadOnlyList <PBETrainerInfo> ti, PBEWildInfo wi, out ReadOnlyCollection <PBETrainer> trainers)
        {
            var allTrainers = new List <PBETrainer>();

            _team0 = new PBETeam(battle, 0, ti, allTrainers);
            _team1 = new PBETeam(battle, 1, wi, allTrainers);
            _team0.OpposingTeam = _team1;
            _team1.OpposingTeam = _team0;
            trainers            = new ReadOnlyCollection <PBETrainer>(allTrainers);
        }
Ejemplo n.º 2
0
        // Wild battle
        internal PBETeam(PBEBattle battle, byte id, PBEWildInfo wi, List <PBETrainer> allTrainers)
        {
            int count = wi.Party.Count;

            if (!VerifyTrainerCount(battle.BattleFormat, count))
            {
                throw new ArgumentException($"Illegal wild Pokémon count (Format: {battle.BattleFormat}, Count: {count}");
            }
            if (!wi.IsOkayForSettings(battle.Settings))
            {
                throw new ArgumentOutOfRangeException(nameof(wi), "Team settings do not comply with battle settings.");
            }
            Battle   = battle;
            Id       = id;
            Trainers = new ReadOnlyCollection <PBETrainer>(new[] { new PBETrainer(this, wi, allTrainers) });
        }