Class PvpQuery

java.lang.Object
privbot.mechanics.PvpQuery

public final class PvpQuery extends Object
What a ctx.pvp.snapshot(..) call should include. Immutable: every method returns a new query.

Pure data: no client calls, safe on any thread.

  • Field Details

  • Method Details

    • all

      public static PvpQuery all()
      Returns:
      a query with the defaults (radius 15, every player, local player excluded)
    • within

      public PvpQuery within(int tiles)
      Parameters:
      tiles - the largest distance in tiles (a negative value is treated as 0)
      Returns:
      a copy with that radius
    • named

      public PvpQuery named(String... names)
      Parameters:
      names - player names; null or blank names are dropped. No names keeps every player.
      Returns:
      a copy that keeps only those players
    • includeLocal

      public PvpQuery includeLocal(boolean include)
      Parameters:
      include - whether the local player is also listed among the opponents
      Returns:
      a copy with that setting
    • radius

      public int radius()
      Returns:
      the radius in tiles
    • names

      public List<String> names()
      Returns:
      the name filter (normalised to lower case), empty for every player
    • includesLocal

      public boolean includesLocal()
      Returns:
      whether the local player is listed among the opponents
    • keeps

      public boolean keeps(String name)
      Parameters:
      name - a player name
      Returns:
      whether the name filter keeps it; a null name is kept only when there is no filter