#pokemon #utilities #collection #index #conversion #github #entry

bin+lib pokemon-utils

a collection of pokemon related utilities Project homepage: https://github.com/isaacadams/pokemon-utils

6 releases

0.1.32 Oct 3, 2024
0.1.31 Jul 29, 2024
0.1.3 Jan 20, 2024
0.1.2 Oct 3, 2023

#115 in Graphics APIs

Download history 16/week @ 2024-09-16 19/week @ 2024-09-23 137/week @ 2024-09-30 14/week @ 2024-10-07 4/week @ 2024-10-14

318 downloads per month

MIT/Apache

120KB
5K SLoC

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

Dependencies

~290–405KB