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

public class AddObjective extends Object implements ItemEffectHandler
An item effect that adds an objective to the OBJECTIVES bag and triggers an "objectiveCollected" event.
  • Constructor Details

    • AddObjective

      public AddObjective()
  • Method Details

    • apply

      public boolean apply(Entity player, EffectConfig cfg)
      Description copied from interface: ItemEffectHandler
      Apply a single effect to the player.
      Specified by:
      apply in interface ItemEffectHandler
      Parameters:
      player - the player entity
      cfg - the effect configuration containing effect parameters
      Returns:
      true if the effect was successfully applied; false otherwise