Class AddUpgrade
java.lang.Object
com.csse3200.game.components.collectables.effects.AddUpgrade
- All Implemented Interfaces:
ItemEffectHandler
Adds an upgrade to the player's inventory and updates stats.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapply(Entity player, EffectConfig cfg) Applies the upgrade effect to the given player.
-
Constructor Details
-
AddUpgrade
public AddUpgrade()
-
-
Method Details
-
apply
Applies the upgrade effect to the given player.- Specified by:
applyin interfaceItemEffectHandler- Parameters:
player- the player entity that should receive the upgradecfg- the effect configuration specifying the target upgrade- Returns:
trueif the upgrade was successfully applied,falseif the player lacks anInventoryComponentor parameters were invalid- Throws:
IllegalArgumentException- if thecfg.targetis null or blank
-