Class BattleLog
java.lang.Object
com.pixelmonmod.pixelmon.battles.controller.log.BattleLog
Logs actions that occur during battles.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Instantprotected final BattleControllerprotected BattleLog.BattleTurnLogprotected final Map<Integer, BattleLog.BattleTurnLog> protected final List<com.pixelmonmod.pixelmon.battles.controller.log.BattleLog.MirroredLog> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanareMessagesInOrder(String... messageSubstrings) exportLogFile(String message) exportLogFile(String message, Exception exception) getActionForPokemon(int turn, PixelmonWrapper pw) Gets a specific action for a Pokémon in the battle log.booleanbooleanisMessagePresent(String messageSubstring) voidlogEvent(Supplier<BattleAction> event) Adds an action to the current turn in the battle log.voidlogMessage(String message) voidMirrors future actions from this log into another battle log.voidmirrorTo(BattleLog battleLog, Function<BattleAction, BattleAction> actionMapper) Mirrors future actions from this log into another battle log, transforming each mirrored action before it is added to the target log.voidLogs a crash in the battle log and ends the battle.voidturnTick(int turn) Moves the log on to the next turn (with the given turn id)
-
Field Details
-
bc
-
battleStart
-
logs
-
mirrors
-
currentTurnLog
-
-
Constructor Details
-
BattleLog
Initializes a battle log.- Parameters:
bc- The battle to log.
-
-
Method Details
-
logEvent
Adds an action to the current turn in the battle log.- Parameters:
event- The action to add.
-
mirrorTo
Mirrors future actions from this log into another battle log.- Parameters:
battleLog- The log that should receive mirrored actions.
-
mirrorTo
Mirrors future actions from this log into another battle log, transforming each mirrored action before it is added to the target log.- Parameters:
battleLog- The log that should receive mirrored actions.actionMapper- The mapper that converts source actions into mirrored actions.
-
logMessage
-
isLoggingDisabled
public boolean isLoggingDisabled() -
getActionForPokemon
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
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
-
isMessagePresent
-
areMessagesInOrder
-
exportLogFile
-
exportLogFile
-
getFilename
-