internal PBEWildPkmnAppearedPacket(byte[] data, EndianBinaryReader r)
        {
            Data = new ReadOnlyCollection <byte>(data);
            var pokemon = new PBEPkmnAppearedInfo[r.ReadByte()];

            for (int i = 0; i < pokemon.Length; i++)
            {
                pokemon[i] = new PBEPkmnAppearedInfo(r);
            }
            Pokemon = new ReadOnlyCollection <PBEPkmnAppearedInfo>(pokemon);
        }
 internal PBEWildPkmnInfo(PBEPkmnAppearedInfo other)
 {
     Species       = other.Species;
     Form          = other.Form;
     Nickname      = other.Nickname;
     Level         = other.Level;
     Shiny         = other.Shiny;
     Gender        = other.Gender;
     HPPercentage  = other.HPPercentage;
     Status1       = other.Status1;
     FieldPosition = other.FieldPosition;
 }
Example #3
0
        internal PBEPkmnSwitchInPacket(byte[] data, EndianBinaryReader r, PBEBattle battle)
        {
            Data    = new ReadOnlyCollection <byte>(data);
            Trainer = battle.Trainers[r.ReadByte()];
            var switches = new PBEPkmnAppearedInfo[r.ReadByte()];

            for (int i = 0; i < switches.Length; i++)
            {
                switches[i] = new PBEPkmnAppearedInfo(r);
            }
            SwitchIns = new ReadOnlyCollection <PBEPkmnAppearedInfo>(switches);
            Forced    = r.ReadBoolean();
            if (Forced)
            {
                ForcedByPokemonTrainer = battle.Trainers[r.ReadByte()];
                ForcedByPokemon        = r.ReadEnum <PBEFieldPosition>();
            }
        }