Class CombatEntity
java.lang.Object
de.gurkenlabs.litiengine.entities.Entity
de.gurkenlabs.litiengine.entities.CollisionEntity
de.gurkenlabs.litiengine.entities.CombatEntity
- All Implemented Interfaces:
EntityRenderedListener,EntityRenderListener,ICollisionEntity,ICombatEntity,IEntity,Tweenable,EventListener
-
Field Summary
FieldsFields inherited from class de.gurkenlabs.litiengine.entities.Entity
ANY_MESSAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCombatEntityListener(CombatEntityListener listener) voiddie()protected voidGets the hit box.Gets the attributes.intgetTeam()float[]getTweenValues(TweenType tweenType) Gets one or many values from the target object associated to the given tween type.voidhit(int damage) voidbooleanisDead()Checks if is dead.booleanisFriendly(ICombatEntity entity) Checks if is friendly.booleanChecks if is indestructible.booleanvoidonDeath(CombatEntityDeathListener listener) voidonHit(CombatEntityHitListener listener) voidonResurrect(CombatEntityResurrectListener listener) voidvoidremoveListener(CombatEntityDeathListener listener) voidremoveListener(CombatEntityHitListener listener) voidremoveListener(CombatEntityResurrectListener listener) voidResurrect.voidsetIndestructible(boolean indestructible) voidsetTarget(ICombatEntity target) voidsetTeam(int team) Sets the team.voidsetTweenValues(TweenType tweenType, float[] newValues) This method is called in a Tween's update() method to set the new interpolated values.booleanwasHit(int timeSpan) Methods inherited from class de.gurkenlabs.litiengine.entities.CollisionEntity
canCollideWith, fireCollisionEvent, getCollisionBox, getCollisionBox, getCollisionBox, getCollisionBoxAlign, getCollisionBoxCenter, getCollisionBoxHeight, getCollisionBoxValign, getCollisionBoxWidth, getCollisionType, hasCollision, onCollision, refreshCollisionBox, removeCollisionListener, setCollision, setCollisionBoxAlign, setCollisionBoxHeight, setCollisionBoxValign, setCollisionBoxWidth, setCollisionType, setHeight, setLocation, setSize, setWidthMethods inherited from class de.gurkenlabs.litiengine.entities.Entity
actions, addController, addEntityRenderListener, addListener, addTag, addTransformListener, animations, attachControllers, behavior, canRender, detachControllers, getAngle, getBoundingBox, getCenter, getController, getControllers, getEnvironment, getHeight, getLocation, getMapId, getName, getProperties, getRenderType, getTags, getWidth, getX, getY, hasTag, isLoaded, isVisible, loaded, onMessage, onMessage, onRendered, perform, register, removed, removeListener, removeListener, removeListener, removeListener, removeListener, removeTag, rendered, rendering, renderWithLayer, sendMessage, setAngle, setController, setLocation, setMapId, setName, setRenderType, setRenderWithLayer, setVisible, setX, setY, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface de.gurkenlabs.litiengine.entities.ICollisionEntity
canCollideWith, fireCollisionEvent, getCollisionBox, getCollisionBox, getCollisionBoxAlign, getCollisionBoxCenter, getCollisionBoxHeight, getCollisionBoxValign, getCollisionBoxWidth, getCollisionType, hasCollision, onCollision, removeCollisionListener, setCollision, setCollisionBoxAlign, setCollisionBoxHeight, setCollisionBoxValign, setCollisionBoxWidth, setCollisionTypeMethods inherited from interface de.gurkenlabs.litiengine.entities.IEntity
actions, addController, addEntityRenderListener, addListener, addTag, addTransformListener, animations, attachControllers, behavior, detachControllers, getAngle, getBoundingBox, getCenter, getController, getEnvironment, getHeight, getLocation, getMapId, getName, getProperties, getRenderType, getTags, getWidth, getX, getY, hasTag, isLoaded, isVisible, loaded, onMessage, onMessage, onRendered, perform, register, removed, removeListener, removeListener, removeListener, removeListener, removeListener, removeTag, renderWithLayer, sendMessage, setAngle, setController, setHeight, setLocation, setLocation, setMapId, setName, setRenderType, setRenderWithLayer, setSize, setVisible, setWidth, setX, setY
-
Field Details
-
DEFAULT_HITPOINTS
public static final int DEFAULT_HITPOINTS- See Also:
-
-
Constructor Details
-
CombatEntity
public CombatEntity()Instantiates a newCombatEntity.
-
-
Method Details
-
addCombatEntityListener
- Specified by:
addCombatEntityListenerin interfaceICombatEntity
-
removeCombatEntityListener
- Specified by:
removeCombatEntityListenerin interfaceICombatEntity
-
onHit
- Specified by:
onHitin interfaceICombatEntity
-
onDeath
- Specified by:
onDeathin interfaceICombatEntity
-
onResurrect
- Specified by:
onResurrectin interfaceICombatEntity
-
removeListener
- Specified by:
removeListenerin interfaceICombatEntity
-
removeListener
- Specified by:
removeListenerin interfaceICombatEntity
-
removeListener
- Specified by:
removeListenerin interfaceICombatEntity
-
die
public void die()- Specified by:
diein interfaceICombatEntity
-
getAppliedEffects
- Specified by:
getAppliedEffectsin interfaceICombatEntity
-
getHitPoints
Gets the attributes.- Specified by:
getHitPointsin interfaceICombatEntity- Returns:
- the attributes
-
getHitBox
Gets the hit box.- Specified by:
getHitBoxin interfaceICombatEntity- Returns:
- the hit box
-
getTarget
- Specified by:
getTargetin interfaceICombatEntity
-
getTeam
public int getTeam()- Specified by:
getTeamin interfaceICombatEntity
-
getTweenValues
Description copied from interface:TweenableGets one or many values from the target object associated to the given tween type. It is used by the Tween Engine to determine starting values.- Specified by:
getTweenValuesin interfaceTweenable- Overrides:
getTweenValuesin classCollisionEntity- Parameters:
tweenType- The tween type of this interpolation, determining which values are modified.- Returns:
- The array of current tween values.
-
setTweenValues
Description copied from interface:TweenableThis method is called in a Tween's update() method to set the new interpolated values.- Specified by:
setTweenValuesin interfaceTweenable- Overrides:
setTweenValuesin classCollisionEntity- Parameters:
tweenType- The tween type of this interpolation, determining which values are modified.newValues- The new values determined by the tween equation.
-
hit
public void hit(int damage) - Specified by:
hitin interfaceICombatEntity
-
hit
- Specified by:
hitin interfaceICombatEntity
-
fireDeathEvent
protected void fireDeathEvent() -
isDead
public boolean isDead()Checks if is dead.- Specified by:
isDeadin interfaceICombatEntity- Returns:
- true, if is dead
-
isFriendly
Checks if is friendly.- Specified by:
isFriendlyin interfaceICombatEntity- Parameters:
entity- the entity- Returns:
- true, if is friendly
-
isIndestructible
public boolean isIndestructible()Checks if is indestructible.- Specified by:
isIndestructiblein interfaceICombatEntity- Returns:
- true, if is indestructible
-
isNeutral
public boolean isNeutral()- Specified by:
isNeutralin interfaceICombatEntity
-
resurrect
public void resurrect()Resurrect.- Specified by:
resurrectin interfaceICombatEntity
-
setIndestructible
public void setIndestructible(boolean indestructible) - Specified by:
setIndestructiblein interfaceICombatEntity
-
setTarget
- Specified by:
setTargetin interfaceICombatEntity
-
setTeam
public void setTeam(int team) Sets the team.- Specified by:
setTeamin interfaceICombatEntity- Parameters:
team- the new team
-
wasHit
public boolean wasHit(int timeSpan) - Specified by:
wasHitin interfaceICombatEntity
-