Class DelayMechanic

java.lang.Object
org.yuemi.mmomechanics.api.skill.mechanic.DelayMechanic
All Implemented Interfaces:
Mechanic

public final class DelayMechanic extends Object implements Mechanic
A Mechanic representing a execution pause in ticks or seconds.
  • Constructor Details

    • DelayMechanic

      public DelayMechanic(@NotNull @NotNull String expression, boolean isSeconds)
      Constructs a DelayMechanic.
      Parameters:
      expression - the mathematical/string expression of the delay amount
      isSeconds - true if the delay is in seconds, false if in ticks
  • Method Details

    • getExpression

      @NotNull public @NotNull String getExpression()
      Gets the parsed delay expression.
      Returns:
      the delay expression
    • isSeconds

      public boolean isSeconds()
      Checks if the delay is represented in seconds.
      Returns:
      true if seconds, false if ticks
    • execute

      public void execute(@NotNull @NotNull SkillContext context, @NotNull @NotNull Collection<Target> targets)
      Description copied from interface: Mechanic
      Executes this mechanic on the provided collection of targets.
      Specified by:
      execute in interface Mechanic
      Parameters:
      context - the context of the skill execution
      targets - the targets to execute this action on