|
LazyLib | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.lazywizard.lazylib.combat.CombatUtils
public class CombatUtils
Contains methods that deal with the battle map in general.
Constructor Summary | |
---|---|
protected |
CombatUtils()
|
Method Summary | |
---|---|
void |
advance(float amount,
java.util.List<com.fs.starfarer.api.input.InputEventAPI> events)
Automatically called by the game. |
static void |
applyForce(com.fs.starfarer.api.combat.CombatEntityAPI entity,
float direction,
float force)
Apply force to an object. |
static void |
applyForce(com.fs.starfarer.api.combat.CombatEntityAPI entity,
org.lwjgl.util.vector.Vector2f direction,
float force)
Apply force to an object. |
static java.util.List<com.fs.starfarer.api.combat.CombatEntityAPI> |
getAsteroidsWithinRange(org.lwjgl.util.vector.Vector2f location,
float range)
Returns all asteroids in range of a given location. |
static java.util.List<com.fs.starfarer.api.combat.CombatEntityAPI> |
getAsteroidsWithinRange(org.lwjgl.util.vector.Vector2f location,
float range,
boolean sortByDistance)
Returns all asteroids in range of a given location. |
static com.fs.starfarer.api.combat.CombatEngineAPI |
getCombatEngine()
Returns the currently used CombatEngineAPI . |
static float |
getElapsedCombatTime()
Returns the length of the current battle. |
static float |
getElapsedCombatTimeIncludingPaused()
Returns the length of the current battle, including time spent paused. |
static java.util.List<com.fs.starfarer.api.combat.CombatEntityAPI> |
getEntitiesWithinRange(org.lwjgl.util.vector.Vector2f location,
float range)
Returns all entities in range of a given location. |
static java.util.List<com.fs.starfarer.api.combat.CombatEntityAPI> |
getEntitiesWithinRange(org.lwjgl.util.vector.Vector2f location,
float range,
boolean sortByDistance)
Returns all entities in range of a given location. |
static java.util.List<com.fs.starfarer.api.combat.MissileAPI> |
getMissilesWithinRange(org.lwjgl.util.vector.Vector2f location,
float range)
Returns all missiles in range of a given location. |
static java.util.List<com.fs.starfarer.api.combat.MissileAPI> |
getMissilesWithinRange(org.lwjgl.util.vector.Vector2f location,
float range,
boolean sortByDistance)
Returns all missiles in range of a given location. |
static java.util.List<com.fs.starfarer.api.combat.BattleObjectiveAPI> |
getObjectivesWithinRange(org.lwjgl.util.vector.Vector2f location,
float range)
Returns all objectives in range of a given location. |
static java.util.List<com.fs.starfarer.api.combat.BattleObjectiveAPI> |
getObjectivesWithinRange(org.lwjgl.util.vector.Vector2f location,
float range,
boolean sortByDistance)
Returns all objectives in range of a given location. |
static java.util.List<com.fs.starfarer.api.combat.DamagingProjectileAPI> |
getProjectilesWithinRange(org.lwjgl.util.vector.Vector2f location,
float range)
Returns all projectiles in range of a given location. |
static java.util.List<com.fs.starfarer.api.combat.DamagingProjectileAPI> |
getProjectilesWithinRange(org.lwjgl.util.vector.Vector2f location,
float range,
boolean sortByDistance)
Returns all projectiles in range of a given location. |
static java.util.List<com.fs.starfarer.api.combat.ShipAPI> |
getShipsWithinRange(org.lwjgl.util.vector.Vector2f location,
float range)
Returns all ships in range of a given location. |
static java.util.List<com.fs.starfarer.api.combat.ShipAPI> |
getShipsWithinRange(org.lwjgl.util.vector.Vector2f location,
float range,
boolean sortByDistance)
Returns all ships in range of a given location. |
static float |
getTimeSinceLastFrame()
Returns the time since the last frame. |
void |
init(com.fs.starfarer.api.combat.CombatEngineAPI engine)
Automatically called by the game. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected CombatUtils()
Method Detail |
---|
public static com.fs.starfarer.api.combat.CombatEngineAPI getCombatEngine()
CombatEngineAPI
.
CombatEngineAPI
used by the current battle.public static float getElapsedCombatTimeIncludingPaused()
public static float getElapsedCombatTime()
public static float getTimeSinceLastFrame()
public static java.util.List<com.fs.starfarer.api.combat.DamagingProjectileAPI> getProjectilesWithinRange(org.lwjgl.util.vector.Vector2f location, float range, boolean sortByDistance)
location
- The location to search around.range
- How far around location
to search.sortByDistance
- Whether to sort the results by distance from location
.
List
of DamagingProjectileAPI
s within range of location
.public static java.util.List<com.fs.starfarer.api.combat.DamagingProjectileAPI> getProjectilesWithinRange(org.lwjgl.util.vector.Vector2f location, float range)
location
- The location to search around.range
- How far around location
to search.
List
of DamagingProjectileAPI
s within range of location
.getProjectilesWithinRange(org.lwjgl.util.vector.Vector2f, float, boolean)
public static java.util.List<com.fs.starfarer.api.combat.MissileAPI> getMissilesWithinRange(org.lwjgl.util.vector.Vector2f location, float range, boolean sortByDistance)
location
- The location to search around.range
- How far around location
to search.sortByDistance
- Whether to sort the results by distance from location
.
List
of MissileAPI
s within range of location
.public static java.util.List<com.fs.starfarer.api.combat.MissileAPI> getMissilesWithinRange(org.lwjgl.util.vector.Vector2f location, float range)
location
- The location to search around.range
- How far around location
to search.
List
of MissileAPI
s within range of location
.getMissilesWithinRange(org.lwjgl.util.vector.Vector2f, float, boolean)
public static java.util.List<com.fs.starfarer.api.combat.ShipAPI> getShipsWithinRange(org.lwjgl.util.vector.Vector2f location, float range, boolean sortByDistance)
location
- The location to search around.range
- How far around location
to search.sortByDistance
- Whether to sort the results by distance from location
.
List
of ShipAPI
s within range of location
.public static java.util.List<com.fs.starfarer.api.combat.ShipAPI> getShipsWithinRange(org.lwjgl.util.vector.Vector2f location, float range)
location
- The location to search around.range
- How far around location
to search.
List
of ShipAPI
s within range of location
.getShipsWithinRange(org.lwjgl.util.vector.Vector2f, float, boolean)
public static java.util.List<com.fs.starfarer.api.combat.CombatEntityAPI> getAsteroidsWithinRange(org.lwjgl.util.vector.Vector2f location, float range, boolean sortByDistance)
location
- The location to search around.range
- How far around location
to search.sortByDistance
- Whether to sort the results by distance from location
.
List
of asteroids within range of location
.public static java.util.List<com.fs.starfarer.api.combat.CombatEntityAPI> getAsteroidsWithinRange(org.lwjgl.util.vector.Vector2f location, float range)
location
- The location to search around.range
- How far around location
to search.
List
of asteroids within range of location
.getAsteroidsWithinRange(org.lwjgl.util.vector.Vector2f, float, boolean)
public static java.util.List<com.fs.starfarer.api.combat.BattleObjectiveAPI> getObjectivesWithinRange(org.lwjgl.util.vector.Vector2f location, float range, boolean sortByDistance)
location
- The location to search around.range
- How far around location
to search.sortByDistance
- Whether to sort the results by distance from location
.
List
of BattleObjectiveAPI
s within range of location
.public static java.util.List<com.fs.starfarer.api.combat.BattleObjectiveAPI> getObjectivesWithinRange(org.lwjgl.util.vector.Vector2f location, float range)
location
- The location to search around.range
- How far around location
to search.
List
of BattleObjectiveAPI
s within range of location
.getObjectivesWithinRange(org.lwjgl.util.vector.Vector2f, float, boolean)
public static java.util.List<com.fs.starfarer.api.combat.CombatEntityAPI> getEntitiesWithinRange(org.lwjgl.util.vector.Vector2f location, float range, boolean sortByDistance)
location
- The location to search around.range
- How far around location
to search.sortByDistance
- Whether to sort the results by distance from location
.
List
of CombatEntityAPI
s within range of location
.public static java.util.List<com.fs.starfarer.api.combat.CombatEntityAPI> getEntitiesWithinRange(org.lwjgl.util.vector.Vector2f location, float range)
location
- The location to search around.range
- How far around location
to search.
List
of CombatEntityAPI
s within range of location
.getEntitiesWithinRange(org.lwjgl.util.vector.Vector2f, float, boolean)
public static void applyForce(com.fs.starfarer.api.combat.CombatEntityAPI entity, org.lwjgl.util.vector.Vector2f direction, float force)
entity
- The CombatEntityAPI
to apply the force to.direction
- The directional vector of the force (this will automatically be normalized).force
- How much force to apply.public static void applyForce(com.fs.starfarer.api.combat.CombatEntityAPI entity, float direction, float force)
entity
- The CombatEntityAPI
to apply the force to.direction
- The angle the force will be applied towards.force
- How much force to apply.public void advance(float amount, java.util.List<com.fs.starfarer.api.input.InputEventAPI> events)
advance
in interface com.fs.starfarer.api.combat.EveryFrameCombatPlugin
public void init(com.fs.starfarer.api.combat.CombatEngineAPI engine)
init
in interface com.fs.starfarer.api.combat.CombatEnginePlugin
|
LazyLib | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |