Class WeaponStatsComponent

java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.combatitemscomponents.WeaponStatsComponent
Direct Known Subclasses:
AreaOfEffectStatsComponent, PhysicalWeaponStatsComponent

public abstract class WeaponStatsComponent extends Component
Component used to store information and methods related to combat such as health, attack, etc. Any entities which engage it combat should have an instance of this class registered. This class can be extended for more specific combat needs.
  • Field Details

    • damage

      protected double damage
    • coolDown

      protected double coolDown
    • materials

      protected Map<Materials,Integer> materials
  • Constructor Details

    • WeaponStatsComponent

      protected WeaponStatsComponent(double damage, double coolDown, Map<Materials,Integer> materials, String description)
      Parameters:
      damage - damage of the weapon
      coolDown - duration before the next attack instance can be called
      materials - materials needed to craft the weapon
  • Method Details

    • getDamage

      public double getDamage()
      Returns the damage of the weapon
      Returns:
      damage of the weapon
    • getCoolDown

      public double getCoolDown()
      Returns the cooldown of the weapon
      Returns:
      duration before the next attack instance can be called
    • setDamage

      public void setDamage(double damage)
      Sets the damage of the weapon
      Parameters:
      damage - damage of the weapon
    • setCoolDown

      public void setCoolDown(double coolDown)
      Sets the cooldown of the weapon
      Parameters:
      coolDown - duration before the next attack instance can be called
    • setDescription

      public void setDescription(String description)
      Sets the description of the weapon
      Parameters:
      description - description of the weapon
    • setMaterials

      public void setMaterials(Map<Materials,Integer> materials)
      Sets the materials required to craft the weapon
      Parameters:
      materials - materials needed to craft the weapon
    • getDescription

      public String getDescription()
      Returns the weapon description
      Returns:
      description of the weapon
    • getMaterials

      public Map<Materials,Integer> getMaterials()
      Returns the materials required to craft the weapon
      Returns:
      materials needed to craft the weapon