The teambuilder object and related classes¶
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.
-
static
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
¶
-