Package megamek.client.bot.princess
Class EnemyTracker
java.lang.Object
megamek.client.bot.princess.EnemyTracker
Tracks enemy units and calculates threat scores based on their positions and capabilities.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublegetClusterThreatScore(Coords clusterCenter) Deprecated, for removal: This API element is subject to removal in a future version.getPriorityTargets(Coords coords, int limit) Returns a list of enemy entities with the highest threat score adjusted to your position.getPriorityTargets(Targetable targetable) Deprecated, for removal: This API element is subject to removal in a future version.static doublehitChance(Game game, Entity entity, Targetable target) Calculates the hit chance of an attack from the entity to the target.voidupdateThreatAssessment(Coords currentSwarmCenter) Updates the threat assessment of the enemy units.
-
Constructor Details
-
EnemyTracker
-
-
Method Details
-
getPriorityTargets
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
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
Updates the threat assessment of the enemy units.- Parameters:
currentSwarmCenter- The current center of the swarm.
-