Class EnemyTracker

java.lang.Object
megamek.client.bot.princess.EnemyTracker

public class EnemyTracker extends Object
Tracks enemy units and calculates threat scores based on their positions and capabilities.
  • Constructor Details

    • EnemyTracker

      public EnemyTracker(Princess owner)
  • Method Details

    • getPriorityTargets

      public List<Entity> getPriorityTargets(Coords coords, int limit)
      Returns a list of enemy entities with the highest threat score adjusted to your position.
      Parameters:
      coords - The position to calculate the threat score from.
      limit - The maximum number of entities to return.
      Returns:
      A list of enemy entities.
    • getPriorityTargets

      @Deprecated(since="0.51.0", forRemoval=true) public List<Entity> getPriorityTargets(Targetable targetable)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a list of enemy entities with the highest threat score adjusted to the targetable.
      Parameters:
      targetable - The targetable position to calculate the threat score from.
      Returns:
      A list of enemy entities with 25% or higher chance of hitting the attack in that target.
    • hitChance

      public static double hitChance(Game game, Entity entity, Targetable target)
      Calculates the hit chance of an attack from the entity to the target.
      Parameters:
      game - The game instance.
      entity - The entity that is attacking.
      target - The targetable that is being attacked.
      Returns:
      The hit chance of the attack.
    • getClusterThreatScore

      @Deprecated(since="0.51.0", forRemoval=true) public double getClusterThreatScore(Coords clusterCenter)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Calculates the threat score of against a cluster to determine how exposed they are
      Parameters:
      clusterCenter - The center of the cluster.
      Returns:
      The threat score against the cluster.
    • updateThreatAssessment

      public void updateThreatAssessment(Coords currentSwarmCenter)
      Updates the threat assessment of the enemy units.
      Parameters:
      currentSwarmCenter - The current center of the swarm.