Class EntityHitEvent
java.lang.Object
java.util.EventObject
de.gurkenlabs.litiengine.entities.EntityHitEvent
- All Implemented Interfaces:
Serializable
Event dispatched whenever an
ICombatEntity is hit. Carries the executor of the hit, the hit entity, the optional triggering ability, the
dealt damage and the resulting kill flag.- See Also:
-
Field Summary
Fields inherited from class EventObject
source -
Method Summary
Modifier and TypeMethodDescriptionGets the ability that triggered the hit, if any.intGets the damage dealt by the hit.Gets the entity that caused the hit (the executor of the triggering ability).Gets the entity that was hit.longgetTime()Gets the game-time timestamp at which the event was dispatched.booleanReturns whether the hit killed the target.Methods inherited from class EventObject
getSource, toString
-
Method Details
-
getDamage
public int getDamage()Gets the damage dealt by the hit.- Returns:
- the damage
-
getExecutor
Gets the entity that caused the hit (the executor of the triggering ability).- Returns:
- the executor, or
nullif no ability triggered the hit
-
getHitEntity
-
wasKilled
public boolean wasKilled()Returns whether the hit killed the target.- Returns:
trueif the target was killed
-
getAbility
Gets the ability that triggered the hit, if any.- Returns:
- the triggering ability, or
null
-
getTime
public long getTime()Gets the game-time timestamp at which the event was dispatched.- Returns:
- the timestamp
-