Interface ArenaPickerAPI


public interface ArenaPickerAPI
This class contains all the API that is relevant to arena pickers.

In case you are looking to obtain an arena given by a condition, you may simply use GameAPI.getArenaByName(String).

  • Method Details

    • getArenasByCondition

      Collection<Arena> getArenasByCondition(String string) throws ArenaConditionParseException
      Parses the given condition and returns all arenas for which the condition applies to.

      An example of an arena condition is [status=2 & teams=4]

      Parameters:
      string - The arena condition string that will be parsed.
      Returns:
      All arenas that meet the pickers conditions
      Throws:
      ArenaConditionParseException - When it failed to parse the String
    • parsePicker

      Parses the picker.
      Parameters:
      string - The String that will be parsed
      Returns:
      The parsed picker
      Throws:
      ArenaConditionParseException - When it failed to parse the condition (because of e.g. malformed syntax)
      ArenaPickerParseException - When it failed to parse the picker (because of e.g. malformed syntax)
    • parseCondition

      Parses the condition.
      Parameters:
      string - The String that will be parsed
      Returns:
      The parsed condition
      Throws:
      ArenaConditionParseException - When it failed (because of e.g. malformed syntax)
    • getConditionVariableNames

      Set<String> getConditionVariableNames()
      Gets the names of all registered condition variables.
      Returns:
      All registered condition variable names
    • getConditionVariables

      Collection<ArenaConditionVariable<?>> getConditionVariables()
      Gets all condition registered condition variables.
      Returns:
      All registered condition variables
    • getConditionVariableByName

      @Nullable @Nullable ArenaConditionVariable<?> getConditionVariableByName(String name)
      Tries to get a condition variable given by its name.
      Parameters:
      name - The name of the condition variable
      Returns:
      The matching condition variable. null if none has been found
    • registerConditionVariable

      boolean registerConditionVariable(ArenaConditionVariable<?> variable)
      Tries to register the condition variable
      Parameters:
      variable - The condition variable instance
      Returns:
      true when it succeded. May fail when e.g. the name is already taken
    • unregisterConditionVariable

      boolean unregisterConditionVariable(ArenaConditionVariable<?> variable)
      Tries to unregister the condition variable
      Parameters:
      variable - The condition variable instance
      Returns:
      true when it has been found and removed
    • isConditionVariableRegistered

      boolean isConditionVariableRegistered(ArenaConditionVariable<?> variable)
      Gets whether a given condition variable instance is currently registered
      Parameters:
      variable - The condition variable instance
      Returns:
      true when it's currently registered
    • getSelectorNames

      Set<String> getSelectorNames()
      Gets the names of all registered selectors.
      Returns:
      The names of all selectors
    • getSelectors

      Collection<ArenaSelector> getSelectors()
      Gets the instances of all registered selectors.
      Returns:
      All registered selectors
    • getSelectorByName

      @Nullable @Nullable ArenaSelector getSelectorByName(String name)
      Tries to find a selector given by its name.
      Parameters:
      name - Its name
      Returns:
      The matching instance. null in case none has been found
    • registerSelector

      boolean registerSelector(ArenaSelector selector)
      Tries to register a new selector instance.
      Parameters:
      selector - The instance that shall be registered
      Returns:
      true when it succeded. May fail when e.g. the name is already taken
    • unregisterSelector

      boolean unregisterSelector(ArenaSelector selector)
      Tries to unregister the given selector instance.
      Parameters:
      selector - The instance that shall be removed
      Returns:
      true when it has been found and unregistered
    • isSelectorRegistered

      boolean isSelectorRegistered(ArenaSelector selector)
      Find out whether a selector is currently registered
      Parameters:
      selector - The given instance
      Returns:
      true in case it's currently registered
    • get

      static ArenaPickerAPI get()
      Returns the global ArenaPickerAPI instance.
      Returns:
      The global ArenaPickerAPI instance