Class StunComponent

java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.components.combat.StunComponent
All Implemented Interfaces:
com.badlogic.gdx.utils.Json.Serializable

public class StunComponent extends Component
A component that manages the stun status of an entity in a game.
  • Constructor Details

    • StunComponent

      public StunComponent()
  • Method Details

    • create

      public void create()
      Initializes the StunComponent and sets up event listeners for stun-related events.
      Overrides:
      create in class Component
    • setStun

      public void setStun(boolean stunned)
      Sets the stun status of the entity.
      Parameters:
      stunned - true if the entity should be stunned; false to remove stun.
    • setStunDuration

      public void setStunDuration(float duration)
      Sets the stun duration for the entity.
      Parameters:
      duration - The duration (in seconds) for which the entity should be stunned.
    • isStunned

      public boolean isStunned()
      Checks whether the entity is currently stunned.
      Returns:
      true if the entity is stunned; false if not stunned.