Class DefenderStatsComponent


public class DefenderStatsComponent extends CombatStatsComponent
An extensions of CombatStatsComponent for defender-type entities.

This component stores additional combat-related stats beyond health and base attack, such as range, attack speed, and critical hit chance.

  • Constructor Details

    • DefenderStatsComponent

      public DefenderStatsComponent(int health, int baseAttack, int type, int range, int state, int attackSpeed, int critChance)
      Creates a new DefenceStatsComponent with the given stats.
      Parameters:
      health - the maximum health of the defender
      baseAttack - the base attack damage
      type - the type identifier of this defender
      range - the maximum attack range
      state - the current combat/behavioural state
      attackSpeed - the speed of attacks
      critChance - the critical hit chance
  • Method Details

    • setType

      public void setType(int type)
      Sets the type of defender.
    • getType

      public int getType()
      Returns:
      the defender type identifier
    • setRange

      public void setRange(int range)
      Sets the defender's attack range.
    • getRange

      public int getRange()
      Returns:
      the defender's maximum attack range
    • setState

      public void setState(int state)
      Sets the defender's current state.
    • getState

      public int getState()
      Returns:
      the defender's current state
    • setAttackSpeed

      public void setAttackSpeed(int attackSpeed)
      Sets the defender's attack speed.
    • getAttackSpeed

      public int getAttackSpeed()
      Returns:
      the defender's attack speed
    • setCritChance

      public void setCritChance(int critChance)
      Sets the defender's critical hit chance (as a percentage).
    • getCritChance

      public int getCritChance()
      Returns:
      the defender's critical hit chance (percentage)