Class RemoveObjective

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

public class RemoveObjective extends Object implements ItemEffectHandler
Effect handler that removes a specific objective from the OBJECTIVES bag if it exists in the player's inventory.
  • Constructor Details

    • RemoveObjective

      public RemoveObjective()
  • Method Details

    • apply

      public boolean apply(Entity player, EffectConfig cfg)
      Removes the specified objective from the player's OBJECTIVES bag.
      Specified by:
      apply in interface ItemEffectHandler
      Parameters:
      player - the entity whose inventory should be modified
      cfg - the effect configuration containing the target objective ID
      Returns:
      true if execution was valid (even if the item did not exist), false if the player or config was invalid