Poke-env
latest
  • Getting started
  • Examples
  • Module documentation
    • Battle objects
    • The move object
    • Other environment objects
    • The player object and related subclasses
    • The pokemon object
    • The teambuilder object and related classes
      • Base Teambuilder
      • Constant teambuilder
      • Teambuilder pokemon
    • Top level modules
Poke-env
  • Docs »
  • Module documentation »
  • The teambuilder object and related classes
  • Edit on GitHub

The teambuilder object and related classes¶

  • Base Teambuilder
  • Constant teambuilder
  • Teambuilder pokemon

Base Teambuilder¶

This module defines the Teambuilder abstract class, which represents objects yielding Pokemon Showdown teams in the context of communicating with Pokemon Showdown.

class poke_env.teambuilder.teambuilder.Teambuilder¶

Bases: abc.ABC

Teambuilder objects allow the generation of teams by Player instances.

They must implement the yield_team method, which must return a valid packed-formatted showdown team every time it is called.

This format is a custom format decribed in Pokemon’s showdown protocol documentation: https://github.com/smogon/pokemon-showdown/blob/master/PROTOCOL.md#team-format

This class also implements a helper function to convert teams from the classical showdown team text format into the packed-format.

static join_team(team: List[poke_env.teambuilder.teambuilder_pokemon.TeambuilderPokemon]) → str¶

Converts a list of TeambuilderPokemon objects into the corresponding packed showdown team format.

Parameters:team (list of TeambuilderPokemon) – The list of TeambuilderPokemon objects that form the team.
Returns:The formatted team string.
Return type:str
static parse_showdown_team(team: str) → List[poke_env.teambuilder.teambuilder_pokemon.TeambuilderPokemon]¶

Converts a showdown-formatted team string into a list of TeambuilderPokemon objects.

This method can be used when using teams built in the showdown teambuilder.

Parameters:team (str) – The showdown-format team to convert.
Returns:The formatted team.
Return type:list of TeambuilderPokemon
yield_team() → str¶

Returns a packed-format team.

Constant teambuilder¶

This module defines the ConstantTeambuilder class, which is a subclass of ShowdownTeamBuilder that yields a constant team.

class poke_env.teambuilder.constant_teambuilder.ConstantTeambuilder(team: str)¶

Bases: poke_env.teambuilder.teambuilder.Teambuilder

yield_team() → str¶

Returns a packed-format team.

Teambuilder pokemon¶

This module defines the TeambuilderPokemon class, which is used as an intermediate format to specify pokemon builds in teambuilders custom classes.

class poke_env.teambuilder.teambuilder_pokemon.TeambuilderPokemon(nickname=None, species=None, item=None, ability=None, moves=None, nature=None, evs=None, gender=None, ivs=None, shiny=None, level=None, happiness=None, hiddenpowertype=None, gmax=None)¶

Bases: object

HP_TO_IVS = {'bug': [31, 31, 31, 30, 31, 30], 'dark': [31, 31, 31, 31, 31, 31], 'dragon': [30, 31, 31, 31, 31, 31], 'electric': [31, 31, 31, 31, 30, 31], 'fighting': [31, 31, 30, 30, 30, 30], 'fire': [31, 30, 31, 30, 31, 30], 'flying': [31, 31, 31, 30, 30, 30], 'ghost': [31, 30, 31, 31, 31, 30], 'grass': [30, 31, 31, 31, 30, 31], 'ground': [31, 31, 31, 31, 30, 30], 'ice': [31, 30, 30, 31, 31, 31], 'poison': [31, 31, 30, 31, 30, 30], 'psychic': [30, 31, 31, 30, 31, 31], 'rock': [31, 31, 30, 30, 31, 30], 'steel': [31, 31, 31, 31, 31, 30], 'water': [31, 31, 31, 30, 30, 31]}¶
STATS_TO_IDX = {'atk': 1, 'def': 2, 'hp': 0, 'satk': 3, 'sdef': 4, 'spa': 3, 'spd': 4, 'spe': 5}¶
formatted¶
formatted_endstring¶
formatted_evs¶
formatted_ivs¶
formatted_moves¶
Next Previous

© Copyright 2022, Haris Sahovic Revision 44481549.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: latest
Versions
latest
stable
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.