pokemon-utils

Crates.iopokemon-utils
lib.rspokemon-utils
version0.1.32
sourcesrc
created_at2023-10-02 00:06:38.40207
updated_at2024-10-03 17:39:53.63681
descriptiona collection of pokemon related utilities Project homepage: https://github.com/isaacadams/pokemon-utils
homepagehttps://github.com/isaacadams/pokemon-utils
repositoryhttps://github.com/isaacadams/pokemon-utils
max_upload_size
id989511
size151,771
Isaac Adams (isaacadams)

documentation

README

Pokemon Utils

a collection of pokemon related utilities

use pokemon_utils::{self, is_rare, PokedexEntry};

fn main() {
    let pokemon = pokemon_utils::encounter_random_pokemon();
    // one way to convert pokemon index into an entry
    let _: &PokedexEntry = PokedexEntry::get_by_id(pokemon as usize).unwrap();
    // another way to do the conversion
    let entry: &PokedexEntry = pokemon.try_into().unwrap();
    println!("found a wild {}!", entry.name);
    println!("is rare? {}", is_rare(&entry.index));
}

Resources

Commit count: 23

cargo fmt