Class ArmourStatsComponent
java.lang.Object
com.deco2800.game.components.Component
com.deco2800.game.components.DefensiveItemsComponents.ArmourStatsComponent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
protected double
protected double
protected double
protected double
-
Constructor Summary
ConstructorsConstructorDescriptionArmourStatsComponent
(double phyResistance, double durability, double vitality, double dmgReturn, double weight, HashMap<Materials, Integer> materials) -
Method Summary
Modifier and TypeMethodDescriptionboolean
equals
(ArmourStatsComponent other) Checks if two ArmourStatsComponents have the same stat.double
double
double
double
double
void
setArmourStats
(double phyResistance, double durability, double vitality, double dmgReturn, double weight, HashMap<Materials, Integer> materials) Sets the attributes of the armour to desired statsvoid
setDmgReturn
(double dmgReturn) void
setDurability
(double durability) void
setMaterials
(HashMap<Materials, Integer> materials) void
setPhyResistance
(double phyResistance) void
setVitality
(double vitality) void
setWeight
(double weight) Methods inherited from class com.deco2800.game.components.Component
create, dispose, earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Field Details
-
phyResistance
protected double phyResistance -
durability
protected double durability -
vitality
protected double vitality -
dmgReturn
protected double dmgReturn -
weight
protected double weight -
materials
-
-
Constructor Details
-
ArmourStatsComponent
public ArmourStatsComponent(double phyResistance, double durability, double vitality, double dmgReturn, double weight, HashMap<Materials, Integer> materials) - Parameters:
phyResistance
- Used to factor with damage reduction (to replace Vitality)durability
- deteremines how long the item will last (SCHEDULED TO BE REMOVED)vitality
- Determines how much extra HP the item gives the playerdmgReturn
- Determines the percentage of damage taken returns to enemyweight
- Determines the speed at which the player moves when using the itemmaterials
- Determines what materials each armour is made of
-
-
Method Details
-
setArmourStats
public void setArmourStats(double phyResistance, double durability, double vitality, double dmgReturn, double weight, HashMap<Materials, Integer> materials) Sets the attributes of the armour to desired stats -
getPhyResistance
public double getPhyResistance()- Returns:
- the physResistance
-
setPhyResistance
public void setPhyResistance(double phyResistance) - Parameters:
phyResistance
- sets the physResistance to desited value
-
getDurability
public double getDurability()- Returns:
- the durability parameter
-
setDurability
public void setDurability(double durability) -
getVitality
public double getVitality()- Returns:
- the Vitality parameter
-
setVitality
public void setVitality(double vitality) -
getDmgReturn
public double getDmgReturn() -
setDmgReturn
public void setDmgReturn(double dmgReturn) - Parameters:
dmgReturn
- is set to the desired value
-
getWeight
public double getWeight()- Returns:
- gets the value of weight
-
setWeight
public void setWeight(double weight) - Parameters:
weight
- sets weight to the desired value
-
getMaterials
- Returns:
- gets the materials required to make the item
-
setMaterials
- Parameters:
materials
- sets materials to make the item
-
equals
Checks if two ArmourStatsComponents have the same stat.- Parameters:
other
- ArmourStatSComponent- Returns:
- true if the stats are the same, false otherwise
-