示例#1
0
        public BoxPokeBox(IPokePC pokePC, uint boxNumber, byte[] rawName, bool boxA, PokeBoxWallpapers wallpaper, byte[] storage)
        {
            this.pokePC      = pokePC;
            this.boxNumber   = boxNumber;
            this.rawName     = rawName;
            this.boxA        = boxA;
            this.wallpaper   = wallpaper;
            this.pokemonList = new IPokemon[30];

            for (int i = 0; i < 30; i++)
            {
                int        boxIndex = (i % 6) + (i / 6) * 12 + (!boxA ? 6 : 0);
                BoxPokemon pkm      = new BoxPokemon(ByteHelper.SubByteArray(boxIndex * 84, storage, 84));
                if (pkm.Experience != 0 && pkm.SpeciesID != 0 && pkm.Checksum != 0)
                {
                    if (pkm.IsValid)
                    {
                        pokemonList[i] = pkm;
                    }
                    else
                    {
                        pokemonList[i] = BoxPokemon.CreateInvalidPokemon(pkm);
                    }
                    pokemonList[i].PokeContainer = this;
                }
            }
        }
示例#2
0
 public XDPokeBox(IPokePC pokePC, byte boxNumber, byte[] data)
 {
     this.pokePC         = pokePC;
     this.raw            = data;
     this.boxNumber      = boxNumber;
     this.wallpaper      = (PokeBoxWallpapers)boxNumber;
     this.pokemonStorage = new PokemonStorage(ByteHelper.SubByteArray(20, data, 196 * 30), PokemonFormatTypes.Gen3XD, this);
 }
示例#3
0
 public GBAPokeBox(IPokePC pokePC, uint boxNumber, byte[] rawName, PokeBoxWallpapers wallpaper)
 {
     this.pokePC         = pokePC;
     this.boxNumber      = boxNumber;
     this.rawName        = rawName;
     this.wallpaper      = wallpaper;
     this.pokemonStorage = new PokemonStorage(new byte[2400], PokemonFormatTypes.Gen3GBA, this);
 }
示例#4
0
 public XDPokeBox(IPokePC pokePC, byte boxNumber, byte[] data)
 {
     this.pokePC = pokePC;
     this.raw = data;
     this.boxNumber = boxNumber;
     this.wallpaper = (PokeBoxWallpapers)boxNumber;
     this.pokemonStorage = new PokemonStorage(ByteHelper.SubByteArray(20, data, 196 * 30), PokemonFormatTypes.Gen3XD, this);
 }
示例#5
0
 public ManagerPokeBox(IPokePC pokePC, uint boxNumber, string name, PokeBoxWallpapers wallpaper)
 {
     this.pokePC               = pokePC;
     this.boxNumber            = boxNumber;
     this.name                 = name;
     this.wallpaper            = wallpaper;
     this.usingCustomWallpaper = false;
     this.wallpaperName        = ((ManagerPokeBoxWallpapers)wallpaper).ToString();
     this.pokemonList          = new GBAPokemon[30];
 }
示例#6
0
 public GBAPokeBox(IPokePC pokePC, uint boxNumber, byte[] rawName, PokeBoxWallpapers wallpaper, byte[] storage)
 {
     if (storage.Length != 2400)
     {
         throw new Exception("GBA Storage size should be 2400 bytes");
     }
     this.pokePC         = pokePC;
     this.boxNumber      = boxNumber;
     this.rawName        = rawName;
     this.wallpaper      = wallpaper;
     this.pokemonStorage = new PokemonStorage(storage, PokemonFormatTypes.Gen3GBA, this);
 }
示例#7
0
 public void Load(byte[] data)
 {
     this.raw        = data;
     this.boxes      = new BoxPokeBox[25 * 2];        // Since boxes are still stored in sets of 30 and not 60 in this program
     this.currentBox = (int)(LittleEndian.ToUInt32(data, 0) * 2);
     for (int i = 0; i < 25; i++)
     {
         byte[]            boxSetData = ByteHelper.SubByteArray(4 + i * 60 * 84, data, 60 * 84);
         PokeBoxWallpapers wallpaper  = (PokeBoxWallpapers)data[4 + 1500 * 84 + 225 + i];
         byte[]            nameRaw    = ByteHelper.SubByteArray(4 + 1500 * 84 + i * 9, data, 9);
         boxes[i * 2]     = new BoxPokeBox(this, (byte)(i * 2), nameRaw, true, wallpaper, boxSetData);
         boxes[i * 2 + 1] = new BoxPokeBox(this, (byte)(i * 2 + 1), nameRaw, false, wallpaper, boxSetData);
     }
 }
示例#8
0
        public BoxPokeBox(IPokePC pokePC, uint boxNumber, byte[] rawName, bool boxA, PokeBoxWallpapers wallpaper, byte[] storage)
        {
            this.pokePC = pokePC;
            this.boxNumber = boxNumber;
            this.rawName = rawName;
            this.boxA = boxA;
            this.wallpaper = wallpaper;
            this.pokemonList = new IPokemon[30];

            for (int i = 0; i < 30; i++) {
                int boxIndex = (i % 6) + (i / 6) * 12 + (!boxA ? 6 : 0);
                BoxPokemon pkm = new BoxPokemon(ByteHelper.SubByteArray(boxIndex * 84, storage, 84));
                if (pkm.Experience != 0 && pkm.SpeciesID != 0 && pkm.Checksum != 0) {
                    if (pkm.IsValid)
                        pokemonList[i] = pkm;
                    else
                        pokemonList[i] = BoxPokemon.CreateInvalidPokemon(pkm);
                    pokemonList[i].PokeContainer = this;
                }
            }
        }
示例#9
0
 public void AddBox(string name, PokeBoxWallpapers wallpaper)
 {
     AddBox(new ManagerPokeBox(this, (byte)boxes.Count, name, wallpaper));
 }
示例#10
0
 public void AddBox(PokeBoxWallpapers wallpaper)
 {
     AddBox(new ManagerPokeBox(this, (byte)boxes.Count, "BOX" + (boxes.Count + 1).ToString(), wallpaper));
 }