Gridarta Editor
net.sf.gridarta.model.gameobject.GameObjectUtils Class Reference

Utility class for GameObject related functions. More...

+ Collaboration diagram for net.sf.gridarta.model.gameobject.GameObjectUtils:

Static Public Member Functions

static String getSyntaxErrors (@NotNull final BaseObject<?, ?, ?, ?> gameObject, @NotNull final ArchetypeType type)
 This method checks the objectText for syntax errors. More...
 

Private Member Functions

 GameObjectUtils ()
 Private constructor to prevent instantiation. More...
 

Detailed Description

Utility class for GameObject related functions.

Author
Andreas Kirschbaum

Definition at line 32 of file GameObjectUtils.java.

Constructor & Destructor Documentation

◆ GameObjectUtils()

net.sf.gridarta.model.gameobject.GameObjectUtils.GameObjectUtils ( )
private

Private constructor to prevent instantiation.

Definition at line 37 of file GameObjectUtils.java.

Member Function Documentation

◆ getSyntaxErrors()

static String net.sf.gridarta.model.gameobject.GameObjectUtils.getSyntaxErrors ( @NotNull final BaseObject<?, ?, ?, ?>  gameObject,
@NotNull final ArchetypeType  type 
)
static

This method checks the objectText for syntax errors.

More precisely: It reads every line in the objectText and looks if it matches the type-definitions (-> see net.sf.gridarta.model.archetypetype.ArchetypeTypeSet) for this base object. If there is no match, the line is considered wrong. Of course the type-definitions will never be perfect, this should be kept in mind.

Note that the archetype is ignored in the check. The default arches should be correct, and even if not - it isn't the map maker to blame.

Parameters
gameObjectthe game object to check
typethe type structure belonging to this base object
Returns
a String with all lines which don't match the type-definitions.
If no such "errors" encountered, null is returned

Definition at line 56 of file GameObjectUtils.java.

References net.sf.gridarta.model.baseobject.BaseObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, T extends BaseObject< G, A, R, T >.DIRECTION, net.sf.gridarta.model.baseobject.BaseObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, T extends BaseObject< G, A, R, T >.NAME, net.sf.gridarta.utils.StringUtils.PATTERN_END_OF_LINE, and net.sf.gridarta.model.baseobject.BaseObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, T extends BaseObject< G, A, R, T >.TYPE.

Referenced by net.sf.gridarta.gui.dialog.gameobjectattributes.GameObjectAttributesDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.applySettings2(), and net.sf.gridarta.gui.panel.gameobjecttexteditor.GameObjectTextEditor.refreshDisplay().

+ Here is the caller graph for this function:

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