Class PhysicalWeaponStatsComponent


public class PhysicalWeaponStatsComponent extends WeaponStatsComponent
Component used to store information and methods related to combat for melee weapons.
  • Constructor Details

    • PhysicalWeaponStatsComponent

      public PhysicalWeaponStatsComponent(double damage, double coolDown, Map<Materials,Integer> materials, double weight, String description)
      Parameters:
      damage - damage of the melee weapon
      coolDown - duration before the next attack instance can be called
      materials - materials needed to craft the weapon
      weight - weight of the weapon (affects player's movement speed)
      description - description of the weapon (used to target weapon animations more effectively)
  • Method Details

    • getWeight

      public double getWeight()
      Returns the weight of the weapon
      Returns:
      weight of the weapon
    • setWeight

      public void setWeight(double weight)
      Sets the weight of the weapons
      Parameters:
      weight - set the weight of the weapon
    • equalsOther

      public boolean equalsOther(PhysicalWeaponStatsComponent other)
      Checks if two melee weapons are the same
      Parameters:
      other - other melee weapon
      Returns:
      true if they have the same stat, false otherwise //implemented by peter from team 02