Package com.fs.starfarer.api.combat
Interface CombatEntityAPI
- All Known Subinterfaces:
BattleObjectiveAPI
,CombatAsteroidAPI
,DamagingProjectileAPI
,EmpArcEntityAPI
,MissileAPI
,ShipAPI
public interface CombatEntityAPI
-
Method Summary
Modifier and TypeMethodDescriptiongetAI()
float
float
DO NOT call .put() methods on the returned map.Can return null if there aren't any bounds, in which case just the collision radius should be used.float
float
float
org.lwjgl.util.vector.Vector2f
float
getMass()
float
int
getOwner()
0 = player 1 = enemy 100 = neutral (used for ship hulks)Returns null for entities without shields.org.lwjgl.util.vector.Vector2f
boolean
boolean
isPointInBounds
(org.lwjgl.util.vector.Vector2f p) void
removeCustomData
(String key) void
setAngularVelocity
(float angVel) void
setCollisionClass
(CollisionClass collisionClass) void
setCollisionRadius
(float radius) Should always circumscribe the bounds, if any.void
setCustomData
(String key, Object data) void
setFacing
(float facing) void
setHitpoints
(float hitpoints) void
setMass
(float mass) void
setOwner
(int owner) 0 = player 1 = enemy 100 = neutral (used for ship hulks)boolean
-
Method Details
-
getLocation
org.lwjgl.util.vector.Vector2f getLocation() -
getVelocity
org.lwjgl.util.vector.Vector2f getVelocity() -
getFacing
float getFacing() -
setFacing
void setFacing(float facing) -
getAngularVelocity
float getAngularVelocity() -
setAngularVelocity
void setAngularVelocity(float angVel) -
getOwner
int getOwner()0 = player 1 = enemy 100 = neutral (used for ship hulks)- Returns:
-
setOwner
void setOwner(int owner) 0 = player 1 = enemy 100 = neutral (used for ship hulks) -
getCollisionRadius
float getCollisionRadius() -
getCollisionClass
CollisionClass getCollisionClass() -
setCollisionClass
-
getMass
float getMass() -
setMass
void setMass(float mass) -
getExactBounds
BoundsAPI getExactBounds()Can return null if there aren't any bounds, in which case just the collision radius should be used. The bounds are guaranteed to be inside the collision radius.- Returns:
-
getShield
ShieldAPI getShield()Returns null for entities without shields.- Returns:
-
getHullLevel
float getHullLevel()- Returns:
- hull level, normalized to (0, 1)
-
getHitpoints
float getHitpoints()- Returns:
- actual hull points left
-
getMaxHitpoints
float getMaxHitpoints()- Returns:
- maximum hull points for the ship
-
setCollisionRadius
void setCollisionRadius(float radius) Should always circumscribe the bounds, if any.- Parameters:
radius
-
-
getAI
Object getAI() -
isExpired
boolean isExpired() -
setCustomData
-
removeCustomData
-
getCustomData
DO NOT call .put() methods on the returned map. Use setCustomData() instead. When the map is empty, it will return a new non-null map that will not be retained, so any additions to it would be lost.- Returns:
-
setHitpoints
void setHitpoints(float hitpoints) -
isPointInBounds
boolean isPointInBounds(org.lwjgl.util.vector.Vector2f p) -
wasRemoved
boolean wasRemoved()
-