java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.log.BattleLog

public class BattleLog extends Object
Logs actions that occur during battles.
  • Field Details

  • Constructor Details

    • BattleLog

      public BattleLog(BattleController bc)
      Initializes a battle log.
      Parameters:
      bc - The battle to log.
  • Method Details

    • logEvent

      public void logEvent(BattleAction event)
      Adds an action to the current turn in the battle log.
      Parameters:
      event - The action to add.
    • getActionForPokemon

      @Nullable public BattleAction getActionForPokemon(int turn, PixelmonWrapper pw)
      Gets a specific action for a Pokémon in the battle log.
      Parameters:
      turn - The turn to get an action from.
      pw - The Pokémon to get an action for.
      Returns:
      The Pokémon's action in the specified turn.
    • turnTick

      public void turnTick(int turn)
      Moves the log on to the next turn (with the given turn id)
    • onCrash

      public void onCrash(Exception exc, String error)
      Logs a crash in the battle log and ends the battle.
      Parameters:
      exc - The exception thrown by the battle.
      error - The error message from the exception.
    • getAllActions

      public List<BattleAction> getAllActions()
    • isMessagePresent

      public boolean isMessagePresent(String messageSubstring)
    • areMessagesInOrder

      public boolean areMessagesInOrder(String... messageSubstrings)
    • exportLogFile

      public CompletableFuture<File> exportLogFile(String message)
    • exportLogFile

      public CompletableFuture<File> exportLogFile(String message, Exception exception)
    • getFilename

      public String getFilename()