public class NamedGameObjectMatcherFilter extends java.lang.Object implements Filter<NamedGameObjectMatcherFilter,NamedGameObjectMatcherFilterConfig>
Filter
which filters according to a NamedGameObjectMatcher
.Constructor and Description |
---|
NamedGameObjectMatcherFilter(@NotNull GameObjectMatcher matcher)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
@NotNull NamedGameObjectMatcherFilterConfig |
createConfig()
Creates a new
FilterConfig instance for this filter. |
boolean |
hasGlobalMatch(@NotNull NamedGameObjectMatcherFilterConfig config)
Tells if all the game objects on a square are to be analyzed before a
match result.
|
boolean |
match(@NotNull NamedGameObjectMatcherFilterConfig config,
@NotNull GameObject<?,?,?> gameObject)
Tells whether we got a match on specific
GameObject . |
boolean |
reset(@NotNull NamedGameObjectMatcherFilterConfig config)
This tells the filter we have finished with current map square and,
perhaps, we are jumping on next one.
|
public NamedGameObjectMatcherFilter(@NotNull @NotNull GameObjectMatcher matcher)
matcher
- the game object matcher to usepublic boolean match(@NotNull @NotNull NamedGameObjectMatcherFilterConfig config, @NotNull @NotNull GameObject<?,?,?> gameObject)
Filter
GameObject
. The analysis
tool will call this function with every game object on a given map
square. The match function is responsible for analyzing inventories if it
needs to. Unless Filter.hasGlobalMatch(FilterConfig)
returns true
, when a match occurred, this function is not called with the
remaining game objects on the map square and a reset is issued.match
in interface Filter<NamedGameObjectMatcherFilter,NamedGameObjectMatcherFilterConfig>
config
- the filter configuration to usegameObject
- the game object being analyzed on the maphasGlobalMatch()
returns true
public boolean reset(@NotNull @NotNull NamedGameObjectMatcherFilterConfig config)
Filter
Filter.hasGlobalMatch(FilterConfig)
returns true
, the returning value is used to know if we had a
match.reset
in interface Filter<NamedGameObjectMatcherFilter,NamedGameObjectMatcherFilterConfig>
config
- the filter configuration to usepublic boolean hasGlobalMatch(@NotNull @NotNull NamedGameObjectMatcherFilterConfig config)
Filter
Filter.match(FilterConfig, GameObject)
is ignored and the returning value of Filter.reset(FilterConfig)
is
used as replacement. This should mainly used by complex analyze filters.hasGlobalMatch
in interface Filter<NamedGameObjectMatcherFilter,NamedGameObjectMatcherFilterConfig>
config
- the filter configuration to use@NotNull public @NotNull NamedGameObjectMatcherFilterConfig createConfig()
Filter
FilterConfig
instance for this filter.createConfig
in interface Filter<NamedGameObjectMatcherFilter,NamedGameObjectMatcherFilterConfig>