Package net.sf.gridarta.model.match
Class NamedGameObjectMatcher
- java.lang.Object
-
- net.sf.gridarta.model.match.NamedGameObjectMatcher
-
- All Implemented Interfaces:
java.io.Serializable,GameObjectMatcher
public class NamedGameObjectMatcher extends java.lang.Object implements GameObjectMatcher
Decorates an arbitraryGameObjectMatcherwith a localized name that is suitable for the user interface. That name can be used to for instance for menu item labels that are used on menu items to toggle theGameObjectMatcheron / off.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NamedGameObjectMatcher(int editType, @NotNull java.lang.String id, @NotNull java.lang.String name, boolean systemMatcher, @Nullable GameObjectMatcher envGameObjectMatcher, @NotNull GameObjectMatcher gameObjectMatcher)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetEditType()Returns the edit type associated with this matcher.@NotNull java.lang.StringgetID()Gets the ID of thisNamedGameObjectMatcher.@NotNull java.lang.StringgetName()Gets the name of thisNamedGameObjectMatcher.booleanisMatching(@NotNull GameObject<?,?,?> gameObject)Matches aGameObject.booleanisSystemMatcher()Returns whether this matcher is a system matcher.
-
-
-
Constructor Detail
-
NamedGameObjectMatcher
public NamedGameObjectMatcher(int editType, @NotNull @NotNull java.lang.String id, @NotNull @NotNull java.lang.String name, boolean systemMatcher, @Nullable @Nullable GameObjectMatcher envGameObjectMatcher, @NotNull @NotNull GameObjectMatcher gameObjectMatcher)Creates a new instance.- Parameters:
editType- the edit typeid- the ID for thisGameObjectMatchername- the localized namesystemMatcher- whether this matcher is a system matcherenvGameObjectMatcher- the environment matchergameObjectMatcher- the matcher to delegate to
-
-
Method Detail
-
getName
@NotNull public @NotNull java.lang.String getName()
Gets the name of thisNamedGameObjectMatcher.- Returns:
- the name of this
NamedGameObjectMatcher
-
isMatching
public boolean isMatching(@NotNull @NotNull GameObject<?,?,?> gameObject)Description copied from interface:GameObjectMatcherMatches aGameObject.- Specified by:
isMatchingin interfaceGameObjectMatcher- Parameters:
gameObject- theGameObjectto match- Returns:
trueif this matcher matches the given game object, otherwisefalse
-
getID
@NotNull public @NotNull java.lang.String getID()
Gets the ID of thisNamedGameObjectMatcher.- Returns:
- the ID of this
NamedGameObjectMatcher
-
getEditType
public int getEditType()
Returns the edit type associated with this matcher. This value is a bit mask and uniquely identifies this matcher.- Returns:
- the edit type
-
isSystemMatcher
public boolean isSystemMatcher()
Returns whether this matcher is a system matcher.- Returns:
- whether this matcher is a system matcher
-
-