public abstract class AbstractFilterConfig<F extends Filter<F,C>,C extends FilterConfig<F,C>> extends java.lang.Object implements FilterConfig<F,C>
Modifier | Constructor and Description |
---|---|
protected |
AbstractFilterConfig(F filter)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addConfigChangeListener(@NotNull FilterConfigListener listener)
Adds a
FilterConfigListener to be notified about changes. |
protected void |
fireEvent(@NotNull FilterConfigChangeType filterConfigChangeType,
@NotNull FilterConfig<?,?> filterConfig)
Notify all listeners that a
FilterConfig has happened. |
F |
getFilter()
Returns the
Filter this filter config belongs to. |
protected abstract C |
getThis()
Returns this filter config.
|
boolean |
isEnabled()
Returns whether the filter is enabled.
|
boolean |
match(@NotNull GameObject<?,?,?> gameObject)
Tells whether we got a match on specific
GameObject . |
void |
removeConfigChangeListener(@NotNull FilterConfigListener listener)
Removes a
FilterConfigListener to be notified about changes. |
boolean |
reset()
Tells the filter we have finished with current map square and, perhaps,
we are jumping on next one.
|
void |
setEnabled(boolean enabled)
Enables or disables the filter.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
accept
protected AbstractFilterConfig(@NotNull F filter)
filter
- the filter this filter config belongs to@NotNull public F getFilter()
FilterConfig
Filter
this filter config belongs to.getFilter
in interface FilterConfig<F extends Filter<F,C>,C extends FilterConfig<F,C>>
public void setEnabled(boolean enabled)
FilterConfig
setEnabled
in interface FilterConfig<F extends Filter<F,C>,C extends FilterConfig<F,C>>
enabled
- whether the filter should be enabledpublic boolean isEnabled()
FilterConfig
isEnabled
in interface FilterConfig<F extends Filter<F,C>,C extends FilterConfig<F,C>>
protected void fireEvent(@NotNull @NotNull FilterConfigChangeType filterConfigChangeType, @NotNull @NotNull FilterConfig<?,?> filterConfig)
FilterConfig
has happened.filterConfigChangeType
- the config event typefilterConfig
- the changed filter configpublic void addConfigChangeListener(@NotNull @NotNull FilterConfigListener listener)
FilterConfig
FilterConfigListener
to be notified about changes.addConfigChangeListener
in interface FilterConfig<F extends Filter<F,C>,C extends FilterConfig<F,C>>
listener
- the listenerpublic void removeConfigChangeListener(@NotNull @NotNull FilterConfigListener listener)
FilterConfig
FilterConfigListener
to be notified about changes.removeConfigChangeListener
in interface FilterConfig<F extends Filter<F,C>,C extends FilterConfig<F,C>>
listener
- the listenerpublic boolean match(@NotNull @NotNull GameObject<?,?,?> gameObject)
FilterConfig
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.match
in interface FilterConfig<F extends Filter<F,C>,C extends FilterConfig<F,C>>
gameObject
- the game object being analyzed on the mappublic boolean reset()
FilterConfig
reset
in interface FilterConfig<F extends Filter<F,C>,C extends FilterConfig<F,C>>
@NotNull protected abstract C getThis()