pub fn load_trainer_party(party: data::Party, mem: &mut Memory) {
    let pokemon = party.pokemon;
    let pokemon_array = [pokemon.0, pokemon.1, pokemon.2, pokemon.3, pokemon.4, pokemon.5];

    let mut addr = (offsets::PROF_OAK_DATA_ADDR & 0x3FFF) as usize;
    let bank = offsets::PROF_OAK_DATA_BANK;

    mem.cart.rom[bank][addr] = 0xFF;
    addr += 1;
    for mon in pokemon_array.iter().take(party.num_pokemon as usize) {
        mem.cart.rom[bank][addr] = mon.level;
        mem.cart.rom[bank][addr + 1] = mon.species;
        addr += 2;
    }
    mem.cart.rom[bank][addr] = 0;
}
/// Loads a target party into the OAK trainer data slot.
Loads a target party into the OAK trainer data slot.
Loads a target party into the OAK trainer data slot .
pub fn load_trainer_party(party: data::Party, mem: &mut Memory) {
    let pokemon = party.pokemon;
    let pokemon_array = [pokemon.0, pokemon.1, pokemon.2, pokemon.3, pokemon.4, pokemon.5];
    let mut addr = (offsets::PROF_OAK_DATA_ADDR & 0x3FFF) as usize;
    let bank = offsets::PROF_OAK_DATA_BANK;
    mem.cart.rom[bank][addr] = 0xFF;
    addr += 1;
    for mon in pokemon_array.iter().take(party.num_pokemon as usize) {
        mem.cart.rom[bank][addr] = mon.level;
        mem.cart.rom[bank][addr + 1] = mon.species;
        addr += 2;
    }
    mem.cart.rom[bank][addr] = 0;
}
pub fn load_trainer_party ( party : data :: Party , mem : & mut Memory ) { let pokemon = party . pokemon ; let pokemon_array = [ pokemon . 0 , pokemon . 1 , pokemon . 2 , pokemon . 3 , pokemon . 4 , pokemon . 5 ] ; let mut addr = ( offsets :: PROF_OAK_DATA_ADDR & 0x3FFF ) as usize ; let bank = offsets :: PROF_OAK_DATA_BANK ; mem . cart . rom [ bank ] [ addr ] = 0xFF ; addr += 1 ; for mon in pokemon_array . iter ( ) . take ( party . num_pokemon as usize ) { mem . cart . rom [ bank ] [ addr ] = mon . level ; mem . cart . rom [ bank ] [ addr + 1 ] = mon . species ; addr += 2 ; } mem . cart . rom [ bank ] [ addr ] = 0 ; }
Loads a target party into the OAK trainer data slot.
Loads a target party into the OAK trainer data slot .
party
data::Party
mem
&mut Memory
party
data::Party
mem
&mut Memory