Interface Cooldownable

All Known Implementing Classes:
Skill

public interface Cooldownable
Interface for skills that have a cooldown system. Enforces a consistent contract for checking, ticking, and using cooldowns.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the number of turns remaining before the skill can be used again.
    boolean
    Checks whether the skill is ready to use.
    void
    Decrements the cooldown by 1; called at the end of every turn.
    void
    use()
    Uses the skill and resets the cooldown.
  • Method Details

    • isReady

      boolean isReady()
      Checks whether the skill is ready to use.
      Returns:
      true if cooldown is 0
    • tickCooldown

      void tickCooldown()
      Decrements the cooldown by 1; called at the end of every turn.
    • use

      void use()
      Uses the skill and resets the cooldown.
      Throws:
      IllegalStateException - if the skill is not yet ready
    • getRemainingCooldown

      int getRemainingCooldown()
      Returns the number of turns remaining before the skill can be used again.
      Returns:
      Remaining turns