Interface ICombatEntity

All Superinterfaces:
ICollisionEntity, IEntity
All Known Implementing Classes:
CombatEntity, Creature, Prop

public interface ICombatEntity extends ICollisionEntity
The ICombatEntity interface defines the methods required for an entity that can engage in combat. It extends the ICollisionEntity interface.
  • Method Details

    • addCombatEntityListener

      void addCombatEntityListener(CombatEntityListener listener)
      Adds a CombatEntityListener to this entity.
      Parameters:
      listener - the listener to add
    • removeCombatEntityListener

      void removeCombatEntityListener(CombatEntityListener listener)
      Removes a CombatEntityListener from this entity.
      Parameters:
      listener - the listener to remove
    • onHit

      void onHit(CombatEntityHitListener listener)
      Registers a listener to be called when this entity is hit.
      Parameters:
      listener - the listener to register
    • removeListener

      void removeListener(CombatEntityHitListener listener)
      Removes a hit listener from this entity.
      Parameters:
      listener - the listener to remove
    • onDeath

      void onDeath(CombatEntityDeathListener listener)
      Registers a listener to be called when this entity dies.
      Parameters:
      listener - the listener to register
    • removeListener

      void removeListener(CombatEntityDeathListener listener)
      Removes a death listener from this entity.
      Parameters:
      listener - the listener to remove
    • onResurrect

      void onResurrect(CombatEntityResurrectListener listener)
      Registers a listener to be called when this entity is resurrected.
      Parameters:
      listener - the listener to register
    • removeListener

      void removeListener(CombatEntityResurrectListener listener)
      Removes a resurrect listener from this entity.
      Parameters:
      listener - the listener to remove
    • die

      void die()
      Causes this entity to die.
    • getAppliedEffects

      List<Effect> getAppliedEffects()
      Gets the list of effects currently applied to this entity.
      Returns:
      a list of applied effects
    • getHitPoints

      RangeAttribute<Integer> getHitPoints()
      Gets the hit points of this entity.
      Returns:
      the hit points as a RangeAttribute
    • getHitBox

      Shape getHitBox()
      Gets the hit box of this entity.
      Returns:
      the hit box as a Shape
    • getTarget

      ICombatEntity getTarget()
      Gets the current target of this entity.
      Returns:
      the target entity
    • getTeam

      int getTeam()
      Gets the team of this entity.
      Returns:
      the team as an integer
    • hit

      void hit(int damage)
      Inflicts damage to this entity.
      Parameters:
      damage - the amount of damage to inflict
    • hit

      void hit(int damage, Ability ability)
      Inflicts damage to this entity with a specific ability.
      Parameters:
      damage - the amount of damage to inflict
      ability - the ability causing the damage
    • isDead

      boolean isDead()
      Checks if this entity is dead.
      Returns:
      true if the entity is dead, false otherwise
    • isFriendly

      boolean isFriendly(ICombatEntity entity)
      Checks if this entity is friendly to another entity.
      Parameters:
      entity - the entity to check against
      Returns:
      true if the entity is friendly, false otherwise
    • isIndestructible

      boolean isIndestructible()
      Checks if this entity is indestructible.
      Returns:
      true if the entity is indestructible, false otherwise
    • isNeutral

      boolean isNeutral()
      Checks if this entity is neutral.
      Returns:
      true if the entity is neutral, false otherwise
    • resurrect

      void resurrect()
      Resurrects this entity.
    • setIndestructible

      void setIndestructible(boolean indestructible)
      Sets the indestructible state of this entity.
      Parameters:
      indestructible - the indestructible state to set
    • setTarget

      void setTarget(ICombatEntity target)
      Sets the target of this entity.
      Parameters:
      target - the target entity to set
    • setTeam

      void setTeam(int team)
      Sets the team of this entity.
      Parameters:
      team - the team to set
    • wasHit

      boolean wasHit(int timeSpan)
      Checks if this entity was hit within a specific time span.
      Parameters:
      timeSpan - the time span to check
      Returns:
      true if the entity was hit within the time span, false otherwise