Interface IMagicAPI


public interface IMagicAPI
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canCast(Spell spell)
    Returns whether or not the given spell can be cast.
    boolean
    cast(Spell spell)
    Selects the "Cast" menu action on the spell widget.
    boolean
    cast(Spell spell, String action)
    Selects the given menu action on the spell widget.
    Gets the selected auto casting spell.
    Gets the currently active spell book.
    boolean
    Gets whether or not a spell is selected in the magic tab.
    boolean
    setAutoCast(Spell spell, boolean defensive)
    Sets the given spell to be auto casted.
  • Method Details

    • isSpellSelected

      boolean isSpellSelected()
      Gets whether or not a spell is selected in the magic tab.
      Returns:
      true if a spell is selected, false otherwise
    • getAutoCastSpell

      Spell getAutoCastSpell()
      Gets the selected auto casting spell.
      Returns:
      the spell or null if no spell is selected to be auto casted
    • canCast

      boolean canCast(Spell spell)
      Returns whether or not the given spell can be cast.
      Parameters:
      spell - the spell, e.g. Spell.Modern.WIND_STRIKE
      Returns:
      true if the spell can be cast, false otherwise
    • cast

      boolean cast(Spell spell)
      Selects the "Cast" menu action on the spell widget.
      Parameters:
      spell - the spell
      Returns:
      true if the spell was cast/selected, false otherwise
    • cast

      boolean cast(Spell spell, String action)
      Selects the given menu action on the spell widget.
      Parameters:
      spell - the spell
      action - the action
      Returns:
      true if the spell was cast/selected, false otherwise
    • setAutoCast

      boolean setAutoCast(Spell spell, boolean defensive)
      Sets the given spell to be auto casted.
      Parameters:
      spell - the spell to be auto casted
      defensive - whether to cast defensively
      Returns:
      true if the spell was selected for auto cast successfully, false otherwise
    • getCurrentSpellBook

      Spell.Book getCurrentSpellBook()
      Gets the currently active spell book.
      Returns:
      the spell book