Package wizardquest.entity
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 TypeMethodDescriptionintcalcDamage(int base, DamageEnum type) Calculate the damage inflicted by one entity onto another.List the abilities that are currently usable by the entity.intGets an entity's current health.intGets an entity's maximum health.getType()Get the enumerated type of the entity.voidloseHealth(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.voidReset an entity's health to its starting value.
-
Method Details
-
loseHealth
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
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.
-