tallgrass/pokemon/location_area
Types
pub type EncounterDetail {
EncounterDetail(
min_level: Int,
max_level: Int,
chance: Int,
method: Resource,
condition_values: List(Resource),
)
}
Constructors
-
EncounterDetail( min_level: Int, max_level: Int, chance: Int, method: Resource, condition_values: List(Resource), )
pub type PokemonLocationArea {
PokemonLocationArea(
location_area: Resource,
version_details: List(VersionDetail),
)
}
Constructors
-
PokemonLocationArea( location_area: Resource, version_details: List(VersionDetail), )
pub type VersionDetail {
VersionDetail(
max_chance: Int,
encounter_details: List(EncounterDetail),
version: Resource,
)
}
Constructors
-
VersionDetail( max_chance: Int, encounter_details: List(EncounterDetail), version: Resource, )
Functions
pub fn fetch_for_pokemon_with_id(
client: Client,
id: Int,
) -> Result(List(PokemonLocationArea), Error)
Fetches a pokemon location area given the pokemon ID.
Example
let result = location_area.new() |> location_area.fetch_for_pokemon_with_id(1)
pub fn fetch_for_pokemon_with_name(
client: Client,
name: String,
) -> Result(List(PokemonLocationArea), Error)
Fetches a pokemon location area given the pokemon name.
Example
let result = location_area.new() |> location_area.fetch_for_pokemon_with_name("bulbasaur")