Class WeaponStatsComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.combatitemscomponents.WeaponStatsComponent
- Direct Known Subclasses:
 AreaOfEffectStatsComponent,PhysicalWeaponStatsComponent
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 Summary
FieldsModifier and TypeFieldDescriptionprotected doubleprotected double - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWeaponStatsComponent(double damage, double coolDown, Map<Materials, Integer> materials, String description)  - 
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the cooldown of the weapondoubleReturns the damage of the weaponReturns the weapon descriptionReturns the materials required to craft the weaponvoidsetCoolDown(double coolDown) Sets the cooldown of the weaponvoidsetDamage(double damage) Sets the damage of the weaponvoidsetDescription(String description) Sets the description of the weaponvoidsetMaterials(Map<Materials, Integer> materials) Sets the materials required to craft the weaponMethods inherited from class com.deco2800.game.components.Component
create, dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update 
- 
Field Details
- 
damage
protected double damage - 
coolDown
protected double coolDown - 
materials
 
 - 
 - 
Constructor Details
 - 
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
Sets the description of the weapon- Parameters:
 description- description of the weapon
 - 
setMaterials
Sets the materials required to craft the weapon- Parameters:
 materials- materials needed to craft the weapon
 - 
getDescription
Returns the weapon description- Returns:
 - description of the weapon
 
 - 
getMaterials
Returns the materials required to craft the weapon- Returns:
 - materials needed to craft the weapon
 
 
 -