public interface Filter<F extends Filter<F,C>,C extends FilterConfig<F,C>>
Interface used to filter and analyze maps. Basically a filter gets an GameObject
and tells if it got a match. It also gets reset when the map
square is changed, So more complex behavior can be achieved.
Modifier and Type | Method and Description |
---|---|
C |
createConfig()
Creates a new
FilterConfig instance for this filter. |
boolean |
hasGlobalMatch(C config)
Tells if all the game objects on a square are to be analyzed before a
match result.
|
boolean |
match(C config,
@NotNull GameObject<?,?,?> gameObject)
Tells whether we got a match on specific
GameObject . |
boolean |
reset(C config)
This tells the filter we have finished with current map square and,
perhaps, we are jumping on next one.
|
boolean match(@NotNull C config, @NotNull @NotNull GameObject<?,?,?> gameObject)
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 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.config
- the filter configuration to usegameObject
- the game object being analyzed on the maphasGlobalMatch()
returns true
boolean reset(@NotNull C config)
hasGlobalMatch(FilterConfig)
returns true
, the returning value is used to know if we had a
match.config
- the filter configuration to useboolean hasGlobalMatch(@NotNull C config)
match(FilterConfig, GameObject)
is ignored and the returning value of reset(FilterConfig)
is
used as replacement. This should mainly used by complex analyze filters.config
- the filter configuration to use@NotNull C createConfig()
FilterConfig
instance for this filter.