Gridarta Editor
net.sf.gridarta.model.match.NamedGameObjectMatcher Class Reference

Decorates an arbitrary GameObjectMatcher with a localized name that is suitable for the user interface. More...

+ Inheritance diagram for net.sf.gridarta.model.match.NamedGameObjectMatcher:
+ Collaboration diagram for net.sf.gridarta.model.match.NamedGameObjectMatcher:

Public Member Functions

int getEditType ()
 Returns the edit type associated with this matcher. More...
 
String getID ()
 Gets the ID of this. More...
 
String getName ()
 Gets the name of this. More...
 
boolean isMatching (@NotNull final GameObject<?, ?, ?> gameObject)
 Matches an GameObject. More...
 
boolean isSystemMatcher ()
 Returns whether this matcher is a system matcher. More...
 
 NamedGameObjectMatcher (final int editType, @NotNull final String id, @NotNull final String name, final boolean systemMatcher, @Nullable final GameObjectMatcher envGameObjectMatcher, @NotNull final GameObjectMatcher gameObjectMatcher)
 Creates a new instance. More...
 

Private Member Functions

boolean isMatchingInventory (@NotNull final GameObject<?, ?, ?> gameObject)
 Returns whether this matcher matches any inventory game object of a given game object. More...
 

Private Attributes

final int editType
 The edit type of this matcher. More...
 
final GameObjectMatcher envGameObjectMatcher
 The environment GameObjectMatcher. More...
 
final GameObjectMatcher gameObjectMatcher
 The GameObjectMatcher to wrap. More...
 
final String id
 The id of this GameObjectMatcher. More...
 
final String name
 The localized name. More...
 
final boolean systemMatcher
 Whether this matcher is a system matcher. More...
 

Static Private Attributes

static final long serialVersionUID = 1L
 The serial version UID. More...
 

Detailed Description

Decorates an arbitrary GameObjectMatcher with 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 the

GameObjectMatcher

on / off.

Author
Christian Hujer

Definition at line 33 of file NamedGameObjectMatcher.java.

Constructor & Destructor Documentation

◆ NamedGameObjectMatcher()

net.sf.gridarta.model.match.NamedGameObjectMatcher.NamedGameObjectMatcher ( final int  editType,
@NotNull final String  id,
@NotNull final String  name,
final boolean  systemMatcher,
@Nullable final GameObjectMatcher  envGameObjectMatcher,
@NotNull final GameObjectMatcher  gameObjectMatcher 
)

Creates a new instance.

Parameters
editTypethe edit type
idthe ID for this
GameObjectMatcher
namethe localized name
systemMatcherwhether this matcher is a system matcher
envGameObjectMatcherthe environment matcher
gameObjectMatcherthe matcher to delegate to

Definition at line 92 of file NamedGameObjectMatcher.java.

References net.sf.gridarta.model.match.NamedGameObjectMatcher.editType, net.sf.gridarta.model.match.NamedGameObjectMatcher.envGameObjectMatcher, net.sf.gridarta.model.match.NamedGameObjectMatcher.gameObjectMatcher, net.sf.gridarta.model.match.NamedGameObjectMatcher.id, net.sf.gridarta.model.match.NamedGameObjectMatcher.name, and net.sf.gridarta.model.match.NamedGameObjectMatcher.systemMatcher.

Member Function Documentation

◆ getEditType()

int net.sf.gridarta.model.match.NamedGameObjectMatcher.getEditType ( )

Returns the edit type associated with this matcher.

This value is a bit mask and uniquely identifies this matcher.

Returns
the edit type

Definition at line 153 of file NamedGameObjectMatcher.java.

References net.sf.gridarta.model.match.NamedGameObjectMatcher.editType.

◆ getID()

String net.sf.gridarta.model.match.NamedGameObjectMatcher.getID ( )

Gets the ID of this.

.

Returns
the ID of this

Definition at line 144 of file NamedGameObjectMatcher.java.

References net.sf.gridarta.model.match.NamedGameObjectMatcher.id.

◆ getName()

String net.sf.gridarta.model.match.NamedGameObjectMatcher.getName ( )

Gets the name of this.

.

Returns
the name of this

Definition at line 106 of file NamedGameObjectMatcher.java.

References net.sf.gridarta.model.match.NamedGameObjectMatcher.name.

◆ isMatching()

boolean net.sf.gridarta.model.match.NamedGameObjectMatcher.isMatching ( @NotNull final GameObject<?, ?, ?>  gameObject)

Matches an GameObject.

Parameters
gameObjectthe
GameObject
to match
Returns
true
if this matcher matches the given game object, otherwise
false

Implements net.sf.gridarta.model.match.GameObjectMatcher.

Definition at line 111 of file NamedGameObjectMatcher.java.

References net.sf.gridarta.model.match.GameObjectMatcher.isMatching(), and net.sf.gridarta.model.match.NamedGameObjectMatcher.isMatchingInventory().

+ Here is the call graph for this function:

◆ isMatchingInventory()

boolean net.sf.gridarta.model.match.NamedGameObjectMatcher.isMatchingInventory ( @NotNull final GameObject<?, ?, ?>  gameObject)
private

Returns whether this matcher matches any inventory game object of a given game object.

envGameObjectMatcher is ignored.

Parameters
gameObjectthe game object to search
Returns
whether a matching inventory game object was found TypeMayBeWeakened // is false warning: weakened type would cause compile-errors

Definition at line 127 of file NamedGameObjectMatcher.java.

References net.sf.gridarta.model.match.GameObjectMatcher.isMatching().

Referenced by net.sf.gridarta.model.match.NamedGameObjectMatcher.isMatching().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSystemMatcher()

boolean net.sf.gridarta.model.match.NamedGameObjectMatcher.isSystemMatcher ( )

Returns whether this matcher is a system matcher.

Returns
whether this matcher is a system matcher

Definition at line 161 of file NamedGameObjectMatcher.java.

References net.sf.gridarta.model.match.NamedGameObjectMatcher.systemMatcher.

Referenced by net.sf.gridarta.model.match.GameObjectMatchersParser.readGameObjectMatchers().

+ Here is the caller graph for this function:

Member Data Documentation

◆ editType

final int net.sf.gridarta.model.match.NamedGameObjectMatcher.editType
private

◆ envGameObjectMatcher

final GameObjectMatcher net.sf.gridarta.model.match.NamedGameObjectMatcher.envGameObjectMatcher
private

The environment GameObjectMatcher.

If non-

null

, this matcher matches a game object only if inside an environment game object that matches this matcher.

Definition at line 67 of file NamedGameObjectMatcher.java.

Referenced by net.sf.gridarta.model.match.NamedGameObjectMatcher.NamedGameObjectMatcher().

◆ gameObjectMatcher

final GameObjectMatcher net.sf.gridarta.model.match.NamedGameObjectMatcher.gameObjectMatcher
private

◆ id

final String net.sf.gridarta.model.match.NamedGameObjectMatcher.id
private

◆ name

final String net.sf.gridarta.model.match.NamedGameObjectMatcher.name
private

◆ serialVersionUID

final long net.sf.gridarta.model.match.NamedGameObjectMatcher.serialVersionUID = 1L
staticprivate

The serial version UID.

Definition at line 38 of file NamedGameObjectMatcher.java.

◆ systemMatcher

final boolean net.sf.gridarta.model.match.NamedGameObjectMatcher.systemMatcher
private

Whether this matcher is a system matcher.

System matchers are not shown in the GUI.

Definition at line 58 of file NamedGameObjectMatcher.java.

Referenced by net.sf.gridarta.model.match.NamedGameObjectMatcher.isSystemMatcher(), and net.sf.gridarta.model.match.NamedGameObjectMatcher.NamedGameObjectMatcher().


The documentation for this class was generated from the following file: