Class ShowdownConverter

java.lang.Object
com.pixelmonmod.pixelmon.api.pokemon.export.impl.ShowdownConverter
All Implemented Interfaces:
PokemonConverterProxy

public class ShowdownConverter extends Object implements PokemonConverterProxy
  • Field Details

  • Constructor Details

    • ShowdownConverter

      public ShowdownConverter()
  • Method Details

    • getExportText

      public String getExportText(Pokemon data)
      Gets exportable text for the Pokémon.
      Specified by:
      getExportText in interface PokemonConverterProxy
      Parameters:
      data - The data object to export from.
      Returns:
      Exportable text for the Pokémon.
    • getColorfulExportText

      public String getColorfulExportText(Pokemon data)
      Gets exportable text for the Pokémon, but colorful!
      Specified by:
      getColorfulExportText in interface PokemonConverterProxy
      Parameters:
      data - The data object to export from.
      Returns:
      Exportable colorful text for the Pokémon.
    • setPokePasteFormAndPalette

      public static String setPokePasteFormAndPalette(Pokemon data, String exportName)
      Sets the Pokémon's form name and palette name that appear on the first line of Pokémon's PokéPaste.
      Parameters:
      data - The Pokémon being converted into PokéPaste/Showdown format.
      exportName - The string that will be edited and returned.
      Returns:
      A string with the (previously defined) Pokémon's species, along with its form and palette.
    • setPokePastePokemonNameColorful

      public static String setPokePastePokemonNameColorful(Pokemon data, String exportName)
      Sets the Pokémon's name (including its form and palette) as the color of the Pokémon's primary type.
      Parameters:
      data - The Pokémon being converted into PokéPaste/Showdown format.
      exportName - The string that will be edited and returned.
      Returns:
      A string with the Pokémon's nickname, species, form, and palette, but colorful.
    • setPokePasteNickname

      public static void setPokePasteNickname(Pokemon data, StringBuilder exportText, String exportName)
      Sets the Pokémon's nickname that appears on the first line of Pokémon's PokéPaste.
      Parameters:
      data - The Pokémon being converted into PokéPaste/Showdown format.
      exportText - The StringBuilder being used to create the text of the PokéPaste.
      exportName - The String that contains info on species, form, and palette.
    • setPokePasteGender

      public static void setPokePasteGender(Pokemon data, StringBuilder exportText)
      Adds the Pokémon's gender to the StringBuilder.
      Parameters:
      data - The Pokémon being converted into PokéPaste/Showdown format.
      exportText - The StringBuilder being used to create the text of the PokéPaste.
    • setColorfulPokePasteGender

      public static void setColorfulPokePasteGender(Pokemon data, StringBuilder exportText)
      Adds the Pokémon's gender to the StringBuilder, adding extra color to make it pretty.
      Parameters:
      data - The Pokémon being converted into PokéPaste/Showdown format.
      exportText - The StringBuilder being used to create the text of the PokéPaste.
    • setPokePasteHeldItem

      public static void setPokePasteHeldItem(Pokemon data, StringBuilder exportText)
      Adds the Pokémon's held item to the StringBuilder.
      Parameters:
      data - The Pokémon being converted into PokéPaste/Showdown format.
      exportText - The StringBuilder being used to create the text of the PokéPaste.
    • setColorfulPokePasteHeldItem

      public static void setColorfulPokePasteHeldItem(Pokemon data, StringBuilder exportText)
      Adds the Pokémon's held item to the StringBuilder, but with potentially extra color.
      Parameters:
      data - The Pokémon being converted into PokéPaste/Showdown format.
      exportText - The StringBuilder being used to create the text of the PokéPaste.
    • addAllColonSeparatedValues

      public static void addAllColonSeparatedValues(Pokemon data, StringBuilder exportText)
      Adds most of the Pokémon's info to the StringBuilder.
      Parameters:
      data - The Pokémon being converted into PokéPaste/Showdown format.
      exportText - The StringBuilder being used to create the text of the PokéPaste.
    • addAllColorfulColonSeparatedValues

      public static void addAllColorfulColonSeparatedValues(Pokemon data, StringBuilder exportText)
      Adds most of the Pokémon's info to the StringBuilder, adding extra color to make it pretty.
      Parameters:
      data - The Pokémon being converted into PokéPaste/Showdown format.
      exportText - The StringBuilder being used to create the text of the PokéPaste.
    • setPokePasteMoves

      public static void setPokePasteMoves(Pokemon data, StringJoiner stringJoiner)
      Adds the Pokémon's moves to the StringBuilder.
      Parameters:
      data - The Pokémon being converted into PokéPaste/Showdown format.
      stringJoiner - The StringJoiner being used to create the text of the PokéPaste.
    • setColorfulPokePasteMoves

      public static void setColorfulPokePasteMoves(Pokemon data, StringJoiner stringJoiner)
      Adds the Pokémon's moves to the StringBuilder, but with extra color.
      Parameters:
      data - The Pokémon being converted into PokéPaste/Showdown format.
      stringJoiner - The StringJoiner being used to create the text of the PokéPaste.
    • addColonSeparated

      public static void addColonSeparated(StringBuilder builder, String label, Object value)
      Separates a label and a value by a colon, and inserts a newline afterwards.
      Parameters:
      builder - The string builder to add the colon-separated string to.
      label - The label to put before the colon.
      value - The value to put after the colon.
    • addColorfulColonSeparated

      public static void addColorfulColonSeparated(StringBuilder builder, String label, Object value)
      Separates a label and a value by a colon, and inserts a newline afterwards, with extra colors.
      Parameters:
      builder - The string builder to add the colon-separated string to.
      label - The label to put before the colon.
      value - The value to put after the colon.
    • importText

      public List<Pokemon> importText(String... importText) throws PokemonImportException
      Description copied from interface: PokemonConverterProxy
      Imports formatted text to a Pokemon instance
      Specified by:
      importText in interface PokemonConverterProxy
      Parameters:
      importText - The formatted text
      Returns:
      The Pokemon instance
      Throws:
      PokemonImportException - thrown when there's an error with the given text
    • importText

      public Pokemon importText(String importText) throws ShowdownImportException
      Parses import text and saves it to the Pokémon.
      Specified by:
      importText in interface PokemonConverterProxy
      Parameters:
      importText - The text to save to the Pokémon.
      Returns:
      Whether the text was successfully parsed.
      Throws:
      ShowdownImportException
    • getIntAfterColon

      public int getIntAfterColon(String string)
      Gets the part of a string that is after a colon, converted to an integer.
      Parameters:
      string - The string to filter.
      Returns:
      The part of the string that is after a colon, converted to an integer.
    • getStringAfterColon

      public String getStringAfterColon(String string)
      Gets the part of a string that is after a colon.
      Parameters:
      string - The string to filter.
      Returns:
      The part of the string that is after a colon.