pokecommand

package
v0.0.0-...-1ef9504 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandBMap

func CommandBMap(locations *LocationArea) error

func CommandCatch

func CommandCatch(name string, cache *pokecache.Cache, pokemon *Pokemon, pokemonURl string) error

func CommandExit

func CommandExit() error

func CommandExplore

func CommandExplore(areaName string, cache *pokecache.Cache, defaultURL string) error

func CommandHelp

func CommandHelp(commands map[string]CliCommand) error

func CommandInspect

func CommandInspect(name string, cache *pokecache.Cache, pokemon *Pokemon) error

func CommandMap

func CommandMap(cache *pokecache.Cache, locations *LocationArea, defaultURL string) error

func CommandPokedex

func CommandPokedex(cache *pokecache.Cache) error

func RegisterExitCallback

func RegisterExitCallback(callback func())

RegisterExitCallback allows the main package to register a callback function for exit.

Types

type CliCommand

type CliCommand struct {
	Name        string
	Description string
	Callback    func(args []string) error
}

type LocationArea

type LocationArea struct {
	Count    int    `json:"count"`
	Next     string `json:"next"`
	Previous string `json:"previous"`
	Results  []struct {
		Name string `json:"name"`
		URL  string `json:"url"`
	} `json:"results"`
}

type LocationPokemonDetails

type LocationPokemonDetails struct {
	PokemonEncounters []struct {
		Pokemon struct {
			Name string `json:"name"`
			URL  string `json:"url"`
		} `json:"pokemon"`
		VersionDetails []struct {
			EncounterDetails []struct {
				Chance          int   `json:"chance"`
				ConditionValues []any `json:"condition_values"`
				MaxLevel        int   `json:"max_level"`
				Method          struct {
					Name string `json:"name"`
					URL  string `json:"url"`
				} `json:"method"`
				MinLevel int `json:"min_level"`
			} `json:"encounter_details"`
			MaxChance int `json:"max_chance"`
			Version   struct {
				Name string `json:"name"`
				URL  string `json:"url"`
			} `json:"version"`
		} `json:"version_details"`
	} `json:"pokemon_encounters"`
}

type Pokemon

type Pokemon struct {
	Abilities []struct {
		Ability struct {
			Name string `json:"name"`
			URL  string `json:"url"`
		} `json:"ability"`
		IsHidden bool `json:"is_hidden"`
		Slot     int  `json:"slot"`
	} `json:"abilities"`
	BaseExperience int    `json:"base_experience"`
	Height         int    `json:"height"`
	ID             int    `json:"id"`
	Name           string `json:"name"`
	Stats          []struct {
		BaseStat int `json:"base_stat"`
		Effort   int `json:"effort"`
		Stat     struct {
			Name string `json:"name"`
			URL  string `json:"url"`
		} `json:"stat"`
	} `json:"stats"`
	Types []struct {
		Slot int `json:"slot"`
		Type struct {
			Name string `json:"name"`
			URL  string `json:"url"`
		} `json:"type"`
	} `json:"types"`
	Weight int `json:"weight"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL