All Known Implementing Classes:
StandardBattleEvaluator

public interface BattleEvaluator
Evaluates the current state of a battle from the perspective of a given team.
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<BattleEvaluator> CODEC
  • Method Details

    • type

    • evaluate

      This method evaluates the current state of the battle, and returns a BattleEvaluationResult.
      This is exposed to provide a greater breakdown of the evaluation, as the BattleEvaluationResult contains a breakdown of the different factors that were considered in the evaluation, and their individual contributions to the overall evaluation value.
      This is useful for debugging and understanding how the evaluation was performed, as well as for providing more detailed information to the user about the evaluation, such as in a battle analysis or in a battle replay.
      The BattleEvaluationContext provided may provide preferences or hints that influence evaluation behavior. Implementations are not required to honor every hint unless explicitly documented.
      To get the overall evaluation value, you can simply call BattleEvaluationResult.getTotalScore(KingfisherSettings) on the result of this method. The score represents how favourable the current state of the battle is for the team being evaluated. The value has the following meaning:
      • Positive - The current state of the battle is favourable for the team being evaluated.
      • Negative - The current state of the battle is unfavourable for the team being evaluated.
      • Zero - The current state of the battle is neutral for the team being evaluated.
      • Larger absolute values indicate stronger advantage or disadvantage
      Parameters:
      context - The context of the battle evaluation
      Returns:
      The result of the battle evaluation, containing a breakdown of the different factors that were considered in the evaluation, and their individual contributions to the overall evaluation value.