Class AddHardware
java.lang.Object
com.csse3200.game.components.collectables.effects.AddHardware
- All Implemented Interfaces:
ItemEffectHandler
Effect that tracks item collectables in the world.
When applied, the player's collected count is incremented if the current
position has not already been collected. The updated count is then broadcast
via the updateCollectables event.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapply(Entity player, EffectConfig cfg) Applies the hardware collection effect to the given player.
-
Constructor Details
-
AddHardware
public AddHardware()
-
-
Method Details
-
apply
Applies the hardware collection effect to the given player.- Specified by:
applyin interfaceItemEffectHandler- Parameters:
player- the player entity that collected the hardwarecfg- the effect configuration containing positional parameters- Returns:
trueif the effect executed successfully,falseif input was invalid
-