Class ArenaPicker

java.lang.Object
de.marcely.bedwars.api.arena.picker.ArenaPicker

public class ArenaPicker extends Object
Represents the final ArenaPicker product that perists of a selector and a bunch of conditions (aka as a condition group).

Use ArenaPickerAPI.parsePicker(String) to parse it given by a String.

  • Constructor Details

  • Method Details

    • getSelector

      public ArenaSelector getSelector()
      Returns the selector.

      The selector decides which one arena shall be choosen from all the arenas that got filtered using getCondition().

      Returns:
      The selector of this picker
    • getCondition

      public ArenaConditionGroup getCondition()
      The condition filters arena.
      Returns:
      The condition of this picker
    • processLocal

      @Nullable public @Nullable Arena processLocal(Collection<Arena> arenas)
      Filters out all local arenas that do not match the conditions and gets the arena that matches the arena.

      The given collection is not being modified in any way.

      Parameters:
      arenas - The local arenas that shall be processed
      Returns:
      The matching arena. null in case all were filtered out or none matches the selector
    • processRemote

      @Nullable public @Nullable RemoteArena processRemote(Collection<? extends RemoteArena> arenas)
      Filters out all remote arenas that do not match the conditions and gets the arena that matches the arena.

      The given collection is not being modified in any way.

      Parameters:
      arenas - The remote arenas that shall be processed
      Returns:
      The matching arena. null in case all were filtered out or none matches the selector
    • processLocal

      @Nullable public @Nullable Arena processLocal()
      Filters out all local arenas that do not match the conditions and gets the arena that matches the arena.

      Uses GameAPI.getArenas() as the reference.

      Returns:
      The matching arena. null in case all were filtered out or none matches the selector
    • processRemote

      @Nullable public @Nullable RemoteArena processRemote()
      Filters out all local arenas that do not match the conditions and gets the arena that matches the arena.

      Uses RemoteAPI.getArenas() as the reference.

      Returns:
      The matching arena. null in case all were filtered out or none matches the selector
    • toString

      public String toString()
      Overrides:
      toString in class Object