Class StatusList

java.lang.Object
games.stendhal.server.entity.status.StatusList

public class StatusList extends Object
handles a list of status for an entity
Author:
hendrik
  • Constructor Details

    • StatusList

      public StatusList(RPEntity entity)
      StatusList for an entity
      Parameters:
      entity - RPEntity which has the statuses managed by this list.
  • Method Details

    • getStatuses

      public List<Status> getStatuses()
      Get statuses that are currently inflicted on the entity
      Returns:
      List of statuses
    • countStatusByType

      public int countStatusByType(StatusType statusType)
      Count how many occurances of a status are inflicted on the entity
      Parameters:
      statusType - type of status being checked
      Returns:
      number of times status is found
    • removeAll

      public <T extends Status> void removeAll(Class<T> statusClass)
      removes all statuses of this class
      Parameters:
      statusClass - status class
    • removeAll

      public void removeAll(StatusType statusType)
      removes all statuses of this type
      Parameters:
      statusType - status type
    • removeAll

      public void removeAll()
      removes all statuses (e. g. on death)
    • hasStatus

      public boolean hasStatus(StatusType statusType)
      Find if the entity has a specified status
      Parameters:
      statusType - the status type to check for
      Returns:
      true, if the entity has status; false otherwise
    • inflictStatus

      public boolean inflictStatus(Status status, Entity attacker)
      Add status effect to entity
      Parameters:
      status - Status to be added
      attacker - Entity that is inflicting status
      Returns:
      true, if the was inflected; false if the RPEntity is immune.
    • isImmune

      public boolean isImmune(StatusType statusType)
      Check if entity is immune to specified status attack.
      Parameters:
      statusType - type of status
      Returns:
      Entity is immune
    • removeImmunity

      public void removeImmunity(StatusType statusType)
      Remove any immunity of specified status effect from entity.
      Parameters:
      statusType - type of status
    • setImmune

      public void setImmune(StatusType statusType)
      Make entity immune to a specified status attack.
      Parameters:
      statusType - Status type
    • remove

      public void remove(Status status)
      removes a status
      Parameters:
      status - Status to remove