public class AIUtils
extends Object
CombatUtils
.Modifier and Type | Method and Description |
---|---|
static boolean |
canUseSystemThisFrame(ShipAPI ship)
Check if a ship's system can be used/toggled this frame.
|
static List<ShipAPI> |
getAlliesOnMap(CombatEntityAPI entity)
Find all present allies of an entity.
|
static Vector2f |
getBestInterceptPoint(Vector2f point,
float speed,
Vector2f targetLoc,
Vector2f targetVel)
Returns the best place to aim to hit a target, given its current location
and velocity.
|
static List<ShipAPI> |
getEnemiesOnMap(CombatEntityAPI entity)
Find all present and visible enemies of an entity.
|
static List<MissileAPI> |
getEnemyMissilesOnMap(CombatEntityAPI entity)
Find all present visible enemy missiles of an entity.
|
static List<ShipAPI> |
getNearbyAllies(CombatEntityAPI entity,
float range)
Finds all allies within a certain range around an entity.
|
static List<ShipAPI> |
getNearbyEnemies(CombatEntityAPI entity,
float range)
Finds all visible enemies within a certain range around an entity.
|
static List<MissileAPI> |
getNearbyEnemyMissiles(CombatEntityAPI entity,
float range)
Finds all visible enemy missiles within a certain range around an entity.
|
static ShipAPI |
getNearestAlly(CombatEntityAPI entity)
Find the closest ally of an entity.
|
static ShipAPI |
getNearestEnemy(CombatEntityAPI entity)
Find the closest visible enemy of an entity.
|
static MissileAPI |
getNearestEnemyMissile(CombatEntityAPI entity)
Find the closest visible enemy missile near an entity.
|
static MissileAPI |
getNearestMissile(CombatEntityAPI entity)
Find the closest visible missile near entity.
|
static BattleObjectiveAPI |
getNearestObjective(CombatEntityAPI entity)
Find the closest
BattleObjectiveAPI to an entity. |
static ShipAPI |
getNearestShip(CombatEntityAPI entity)
Find the closest visible ship near an entity.
|
public static BattleObjectiveAPI getNearestObjective(CombatEntityAPI entity)
BattleObjectiveAPI
to an entity.entity
- The CombatEntityAPI
to search around.
BattleObjectiveAPI
closest to entity
.
public static ShipAPI getNearestEnemy(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.
entity
who can be seen within the
fog of war.
public static ShipAPI getNearestAlly(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.
entity
.
public static ShipAPI getNearestShip(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.
entity
that can be seen within the
fog of war.
public static MissileAPI getNearestMissile(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.
MissileAPI
closest to entity
that can be seen
within the fog of war.
public static List<ShipAPI> getEnemiesOnMap(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.
entity
on the battle map that can be seen
within the fog of war.
public static List<ShipAPI> getNearbyEnemies(CombatEntityAPI entity, float range)
entity
- The entity to search around.range
- How far around entity
to search.
List
containing all enemy ships within range that can
be seen within the fog of war.
public static List<ShipAPI> getAlliesOnMap(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.
entity
on the battle map.
public static List<ShipAPI> getNearbyAllies(CombatEntityAPI entity, float range)
entity
- The entity to search around.range
- How far around entity
to search.
List
containing all allied ships within range.
public static MissileAPI getNearestEnemyMissile(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.
MissileAPI
closest to entity
that can
be seen within the fog of war.
public static List<MissileAPI> getEnemyMissilesOnMap(CombatEntityAPI entity)
entity
- The CombatEntityAPI
to search around.
MissileAPI
s of entity
on the battle
map that can be seen within the fog of war.
public static List<MissileAPI> getNearbyEnemyMissiles(CombatEntityAPI entity, float range)
entity
- The entity to search around.range
- How far around entity
to search.
List
containing all enemy missiles within range that
can be seen within the fog of war.
public static Vector2f getBestInterceptPoint(Vector2f point, float speed, Vector2f targetLoc, Vector2f targetVel)
point
- The origin point of the object that will attempt to
collide with the target (usually a weapon's projectile
spawn point).speed
- The speed of the object that will attempt to collide
with the target (usually a projectile's travel speed).targetLoc
- The location of the target.targetVel
- The current velocity of the target.
target
given current
velocities, or null
if a collision is not possible.
public static boolean canUseSystemThisFrame(ShipAPI ship)
ship
- The ship to check the system of.
true
if ship
can use its system, false
otherwise.