Skip to content
This repository has been archived by the owner on Jul 9, 2019. It is now read-only.

pogobuf.Utils Methods

Andreas Reich edited this page Nov 20, 2016 · 4 revisions

pogobuf.Utils methods

getCellIDs(lat, lng, [radius], [level])array (static)

Provides cell IDs of nearby cells based on the given coords and radius.

Param Type Description
lat number Latitude
lng number Longitude
radius number Radius of the square in cells (optional) (default value is 3)
level number S2 cell level (optional) (default value is 15)

splitInventory(inventory)object (static)

Takes a getInventory() response and separates it into pokemon, items, candies, player data, eggs, quests, and pokedex.

Param Type Description
inventory object API response message as returned by getInventory()

splitItemTemplates(templates)object (static)

Takes a downloadItemTemplates() response and separates it into the individual settings objects. data, eggs, and pokedex.

Param Type Description
templates object API response message as returned by downloadItemTemplates()

getEnumKeyByValue(enumObj, val)string (static)

Utility method that finds the name of the key for a given enum value and makes it look a little nicer.

Param Type
enumObj object
val number

getIVsFromPokemon(pokemon)object (static)

Utility method to get the Individual Values from Pokémon

Param Type Description
pokemon object A pokemon_data structure

convertLongs(object)object (static)

Takes an object and converts all Long.js objects to integers or strings and returns the object with readable longs.

Param Type Description
object object An object