java.lang.Object
com.csse3200.game.components.collectables.effects.AddHardware
All Implemented Interfaces:
ItemEffectHandler

public class AddHardware extends Object implements 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 Details

    • AddHardware

      public AddHardware()
  • Method Details

    • apply

      public boolean apply(Entity player, EffectConfig cfg)
      Applies the hardware collection effect to the given player.
      Specified by:
      apply in interface ItemEffectHandler
      Parameters:
      player - the player entity that collected the hardware
      cfg - the effect configuration containing positional parameters
      Returns:
      true if the effect executed successfully, false if input was invalid