Package net.sf.gridarta.model.filter
Interface FilterConfig<F extends Filter<F,C>,C extends FilterConfig<F,C>>
-
- All Known Implementing Classes:
AbstractFilterConfig,NamedFilterConfig,NamedGameObjectMatcherFilterConfig
public interface FilterConfig<F extends Filter<F,C>,C extends FilterConfig<F,C>>Interface for filter configurations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaccept(@NotNull FilterConfigVisitor visitor)Visits the appropriatevisit()function of aFilterConfigVisitor.voidaddConfigChangeListener(FilterConfigListener listener)Adds aFilterConfigListenerto be notified about changes.FgetFilter()Returns theFilterthis filter config belongs to.booleanisEnabled()Returns whether the filter is enabled.booleanmatch(@NotNull GameObject<?,?,?> gameObject)Tells whether we got a match on specificGameObject.voidremoveConfigChangeListener(FilterConfigListener listener)Removes aFilterConfigListenerto be notified about changes.booleanreset()Tells the filter we have finished with current map square and, perhaps, we are jumping on next one.voidsetEnabled(boolean enabled)Enables or disables the filter.
-
-
-
Method Detail
-
getFilter
@NotNull F getFilter()
Returns theFilterthis filter config belongs to.- Returns:
- the filter
-
setEnabled
void setEnabled(boolean enabled)
Enables or disables the filter.- Parameters:
enabled- whether the filter should be enabled
-
isEnabled
boolean isEnabled()
Returns whether the filter is enabled.- Returns:
- whether the filter is enabled
-
addConfigChangeListener
void addConfigChangeListener(FilterConfigListener listener)
Adds aFilterConfigListenerto be notified about changes.- Parameters:
listener- the listener
-
removeConfigChangeListener
void removeConfigChangeListener(FilterConfigListener listener)
Removes aFilterConfigListenerto be notified about changes.- Parameters:
listener- the listener
-
accept
void accept(@NotNull @NotNull FilterConfigVisitor visitor)Visits the appropriatevisit()function of aFilterConfigVisitor.- Parameters:
visitor- the visitor to call
-
match
boolean match(@NotNull @NotNull GameObject<?,?,?> gameObject)Tells whether we got a match on specificGameObject. 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.- Parameters:
gameObject- the game object being analyzed on the map- Returns:
- whether it matches the criteria
-
reset
boolean reset()
Tells the filter we have finished with current map square and, perhaps, we are jumping on next one.- Returns:
- whether we had a global match on the map square
-
-