Class GroundItems


  • public final class GroundItems
    extends java.lang.Object
    For retrieval, sorting, and analysis of GroundItems
    • Method Detail

      • contains

        public static boolean contains​(java.util.function.Predicate<GroundItem> filter)
        Checks if any items match the given filter
        Parameters:
        filter - the predicate to check the items against
        Returns:
        true if an item matches the filter
      • contains

        public static boolean contains​(int id)
        Checks if any items match the given id
        Parameters:
        id - the id to check the items against
        Returns:
        true if an item matches the id
      • contains

        public static boolean contains​(java.lang.String name)
        Checks if any items match the given name
        Parameters:
        name - the name to check the items against
        Returns:
        true if an item matches the name
      • contains

        public static boolean contains​(java.util.regex.Pattern name)
        Checks if any items match the given name
        Parameters:
        name - the name to check the items against
        Returns:
        true if an item matches the name
      • containsAllOf

        public static boolean containsAllOf​(java.util.function.Predicate<GroundItem> predicate)
        Checks if the supplied filter matches at least one item
        Parameters:
        predicate - the predicate to check the items against
        Returns:
        true if the predicate matches an item
      • containsAllOf

        @SafeVarargs
        public static boolean containsAllOf​(java.util.function.Predicate<GroundItem>... filters)
        Checks if all of the supplied filters match at least one item each
        Parameters:
        filters - the predicates to check the items against
        Returns:
        true if all of the predicates have a match
      • containsAllOf

        public static boolean containsAllOf​(int... ids)
        Checks if all of the supplied ids match at least one item each
        Parameters:
        ids - the ids to check the items against
        Returns:
        true if all of the ids have a match
      • containsAllOf

        public static boolean containsAllOf​(java.lang.String... names)
        Checks if all of the supplied names match at least one item each
        Parameters:
        names - the names to check the items against
        Returns:
        true if all of the names have a match
      • containsAllOf

        public static boolean containsAllOf​(java.util.regex.Pattern... names)
        Checks if all of the supplied names match at least one item each
        Parameters:
        names - the names to check the items against
        Returns:
        true if all of the names have a match
      • containsAnyExcept

        public static boolean containsAnyExcept​(java.util.function.Predicate<GroundItem> filter)
        Checks if any items don't match the given filter
        Parameters:
        filter - the predicate to check the items against
        Returns:
        true if at least one item doesn't match the filter
      • containsAnyExcept

        @SafeVarargs
        public static boolean containsAnyExcept​(java.util.function.Predicate<GroundItem>... filters)
        Checks if any items don't match the given filters
        Parameters:
        filters - the predicates to check the items against
        Returns:
        true if at least one item doesn't match the filters
      • containsAnyExcept

        public static boolean containsAnyExcept​(int... ids)
        Checks if any items don't match the given ids
        Parameters:
        ids - the ids to check the items against
        Returns:
        true if at least one item doesn't match the ids
      • containsAnyExcept

        public static boolean containsAnyExcept​(java.lang.String... names)
        Checks if any items don't match the given names
        Parameters:
        names - the names to check the items against
        Returns:
        true if at least one item doesn't match the names
      • containsAnyExcept

        public static boolean containsAnyExcept​(java.util.regex.Pattern... names)
        Checks if any items don't match the given names
        Parameters:
        names - the names to check the items against
        Returns:
        true if at least one item doesn't match the names
      • containsAnyOf

        public static boolean containsAnyOf​(java.util.function.Predicate<GroundItem> filter)
        Checks if any item matches the given filter
        Parameters:
        filter - the filter to check the items against
        Returns:
        true if at least one item matches the filter
      • containsAnyOf

        @SafeVarargs
        public static boolean containsAnyOf​(java.util.function.Predicate<GroundItem>... filters)
        Checks if any item matches the given filters
        Parameters:
        filters - the filters to check the items against
        Returns:
        true if at least one item matches a filter
      • containsAnyOf

        public static boolean containsAnyOf​(int... ids)
        Checks if any item matches the given ids
        Parameters:
        ids - the ids to check the items against
        Returns:
        true if at least one item matches an id
      • containsAnyOf

        public static boolean containsAnyOf​(java.lang.String... names)
        Checks if any item matches the given names
        Parameters:
        names - the names to check the items against
        Returns:
        true if at least one item matches a name
      • containsAnyOf

        public static boolean containsAnyOf​(java.util.regex.Pattern... names)
        Checks if any item matches the given names
        Parameters:
        names - the names to check the items against
        Returns:
        true if at least one item matches a name
      • containsOnly

        public static boolean containsOnly​(java.util.function.Predicate<GroundItem> filter)
        Checks if all of the items match the given filter
        Parameters:
        filter - the filter to check the items against
        Returns:
        true if all items match the filter
      • containsOnly

        @SafeVarargs
        public static boolean containsOnly​(java.util.function.Predicate<GroundItem>... filters)
        Checks if all of the items match the given filters
        Parameters:
        filters - the filters to check the items against
        Returns:
        true if all items match at least one filter each
      • containsOnly

        public static boolean containsOnly​(java.lang.String... names)
        Checks if all of the items match the given names
        Parameters:
        names - the filters to check the items against
        Returns:
        true if all items match at least one name each
      • containsOnly

        public static boolean containsOnly​(java.util.regex.Pattern... names)
        Checks if all of the items match the given names
        Parameters:
        names - the filters to check the items against
        Returns:
        true if all items match at least one name each
      • getQuantity

        public static int getQuantity()
        Gets the total quantity of items
        Returns:
        the total quantity of items
      • getQuantity

        public static int getQuantity​(java.util.function.Predicate<GroundItem> filter)
        Gets the total quantity of items matching the filter
        Parameters:
        filter - the filter to check the items against
        Returns:
        the total quantity of items matching the filter
      • getQuantity

        @SafeVarargs
        public static int getQuantity​(java.util.function.Predicate<GroundItem>... filters)
        Gets the total quantity of items matching the filters
        Parameters:
        filters - the filters to check the items against
        Returns:
        the total quantity of items matching the filters
      • getQuantity

        public static int getQuantity​(int... ids)
        Gets the total quantity of items matching the ids
        Parameters:
        ids - the ids to check the items against
        Returns:
        the total quantity of items matching the ids
      • getQuantity

        public static int getQuantity​(java.lang.String... names)
        Gets the total quantity of items matching the names
        Parameters:
        names - the ids to check the items against
        Returns:
        the total quantity of items matching the names
      • getQuantity

        public static int getQuantity​(java.util.regex.Pattern... names)
        Gets the total quantity of items matching the names
        Parameters:
        names - the ids to check the items against
        Returns:
        the total quantity of items matching the names
      • getAreaPredicate

        public static java.util.function.Predicate<GroundItem> getAreaPredicate​(Area... acceptedAreas)
      • getNamePredicate

        @Deprecated
        public static java.util.function.Predicate<GroundItem> getNamePredicate​(java.lang.String... acceptedNames)
        Gets a GroundItem filter that can be used to get a GroundItem with one of the specified names
        Parameters:
        acceptedNames - the names that are valid (case-sensitive)
        Returns:
        a filter
      • getActionPredicate

        @Deprecated
        public static java.util.function.Predicate<GroundItem> getActionPredicate​(java.lang.String... acceptedActions)
        Gets a GroundItem filter that can be used to get the items with the specified ground powers
        Parameters:
        acceptedActions - the powers that are valid (case-sensitive)
        Returns:
        a filter