Interface EntityInterface

All Known Subinterfaces:
PlayerInterface
All Known Implementing Classes:
AbsolutePulseUnlockUpgrade, EnemyBase, FireBallUnlockUpgrade, FireDamageResistanceUpgrade, FishMan, Goblin, PhysicalDamageResistanceUpgrade, Player, SlashUnlockUpgrade, ThunderDamageResistanceUpgrade, ThunderStormUnlockUpgrade, UpgradeBase, WaterDamageResistanceUpgrade, WaterJetUnlockUpgrade

public interface EntityInterface
Interface for entities. Provides methods for damage calculation and health management.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    calcDamage(int base, DamageEnum type)
    Calculate the damage inflicted by one entity onto another.
    List the abilities that are currently usable by the entity.
    int
    Gets an entity's current health.
    int
    Gets an entity's maximum health.
    Get the enumerated type of the entity.
    void
    loseHealth(int amount, DamageEnum type)
    Decrements an entity's health by a given amount, as a result of a certain damage type being inflicted upon them.
    void
    Reset an entity's health to its starting value.
  • Method Details

    • loseHealth

      void loseHealth(int amount, DamageEnum type) throws IllegalArgumentException
      Decrements an entity's health by a given amount, as a result of a certain damage type being inflicted upon them.
      Parameters:
      amount - the total health that the entity will lose.
      type - the inflicted damage type that has caused this health loss.
      Throws:
      IllegalArgumentException - if amount is not a non-negative number.
    • getHealth

      int getHealth()
      Gets an entity's current health.
      Returns:
      the entity's current health.
    • getMaxHealth

      int getMaxHealth()
      Gets an entity's maximum health.
      Returns:
      the entity's maximum health.
    • calcDamage

      int calcDamage(int base, DamageEnum type)
      Calculate the damage inflicted by one entity onto another. Applies damage type modifiers to the base damage to calculate the final amount.
      Parameters:
      base - the base damage dealt by the entity's attack.
      type - the damage type of the entity's attack.
      Returns:
      the total damage inflicted by this attack.
    • getAbilities

      List<AbilityEnum> getAbilities()
      List the abilities that are currently usable by the entity.
      Returns:
      a list of abilities.
    • resetHealth

      void resetHealth()
      Reset an entity's health to its starting value.
    • getType

      EntityEnum getType()
      Get the enumerated type of the entity.
      Returns:
      the entity type.