Package com.csse3200.game.components
Class GeneratorStatsComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.CombatStatsComponent
com.csse3200.game.components.GeneratorStatsComponent
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionGeneratorStatsComponent
(int health, int interval, int scrapValue) Creates a new GeneratorStatsComponent with the given stats -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the current interval value.int
Returns the current scrap value.void
setInterval
(int interval) Sets the interval value.void
setScrapValue
(int scrapValue) Sets the scrap value.Methods inherited from class com.csse3200.game.components.CombatStatsComponent
addHealth, getBaseAttack, getHealth, handleDeath, hit, isDead, setBaseAttack, setHealth
Methods inherited from class com.csse3200.game.components.Component
create, dispose, earlyUpdate, getEntity, getPriority, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
GeneratorStatsComponent
public GeneratorStatsComponent(int health, int interval, int scrapValue) Creates a new GeneratorStatsComponent with the given stats- Parameters:
health
- the maximum health of the generatorinterval
- the currency generation ratescrapValue
- the value of the scrap generated
-
-
Method Details
-
getInterval
public int getInterval()Returns the current interval value.- Returns:
- the interval
-
setInterval
public void setInterval(int interval) Sets the interval value. If the provided value is negative, the interval is set to 0- Parameters:
interval
- new interval
-
getScrapValue
public int getScrapValue()Returns the current scrap value.- Returns:
- the scrap value
-
setScrapValue
public void setScrapValue(int scrapValue) Sets the scrap value. if the provided value is negative, the scrap value is set to 0- Parameters:
scrapValue
- new scrap value
-