Gridarta Editor
net.sf.gridarta.var.daimonin.model.io.ArchetypeParser Class Reference

Handles the parsing of arches. More...

+ Inheritance diagram for net.sf.gridarta.var.daimonin.model.io.ArchetypeParser:
+ Collaboration diagram for net.sf.gridarta.var.daimonin.model.io.ArchetypeParser:

Public Member Functions

 ArchetypeParser (@NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet< GameObject, MapArchObject, Archetype > archetypeSet, @NotNull final GameObjectFactory< GameObject, MapArchObject, Archetype > gameObjectFactory, @NotNull final MultiPositionData multiPositionData)
 Creates an ArchetypeParser. More...
 
- Public Member Functions inherited from net.sf.gridarta.model.io.AbstractArchetypeParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, B extends AbstractArchetypeBuilder< G, A, R >
void parseArchetypeFromStream (@NotNull final BufferedReader in, @Nullable final R prototype, @Nullable final String line, @Nullable final String archName, @NotNull final String panelName, @NotNull final String folderName, @NotNull final String archPath, @NotNull final List< G > invObjects, @NotNull final ErrorViewCollector errorViewCollector) throws IOException
 
- Public Member Functions inherited from net.sf.gridarta.model.io.ArchetypeParser< G, A, R >
void parseArchetypeFromStream ( @NotNull BufferedReader in, @Nullable R prototype, @Nullable String line, @Nullable String archName, @NotNull String panelName, @NotNull String folderName, @NotNull String archPath, @NotNull List< G > invObjects, @NotNull ErrorViewCollector errorViewCollector) throws IOException
 Here we read an Archetype from a BufferedReader, parse the data and put the result in the ArchetypeSet in CMainControl. More...
 

Protected Member Functions

boolean addToPanel (final boolean isInternPath, @NotNull final String editorFolder, @NotNull final Archetype archetype)
 
void finishParseArchetype (@NotNull final Archetype archetype)
 
void finishParseArchetypePart (@Nullable final Archetype firstArch, @NotNull final Archetype archetype, @NotNull final ErrorViewCollector errorViewCollector)
 
void initParseArchetype ()
 Called when a new archetype starts. More...
 
boolean isStartLine (@NotNull final String line)
 Returns whether a give input line denotes the start of a new archetype. More...
 
boolean processLine (@NotNull final BufferedReader in, @NotNull final String line, @NotNull final String line2, @NotNull final DefaultArchetypeBuilder archetypeBuilder, @NotNull final ErrorViewCollector errorViewCollector, @NotNull final List< GameObject > invObjects)
 
- Protected Member Functions inherited from net.sf.gridarta.model.io.AbstractArchetypeParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, B extends AbstractArchetypeBuilder< G, A, R >
 AbstractArchetypeParser (@NotNull final B archetypeBuilder, @NotNull final AnimationObjects animationObjects, @NotNull final ArchetypeSet< G, A, R > archetypeSet)
 Creates an ArchetypeParser. More...
 
abstract boolean addToPanel (boolean isInternPath, @NotNull String editorFolder, @NotNull R archetype)
 Returns whether an archetype should be added to the archetype chooser. More...
 
abstract void finishParseArchetype (@NotNull R archetype)
 Called after all parts of an archetype have been processed. More...
 
abstract void finishParseArchetypePart (@Nullable R firstArch, @NotNull R archetype, @NotNull ErrorViewCollector errorViewCollector)
 Called after the "end" line of a part has been read. More...
 
abstract boolean processLine (@NotNull BufferedReader in, @NotNull String line, @NotNull String line2, @NotNull B archetypeBuilder, @NotNull ErrorViewCollector errorViewCollector, @NotNull List< G > invObjects) throws IOException
 Called for each processed line. More...
 

Private Member Functions

void calculateLowestMulti (final net.sf.gridarta.model.archetype.Archetype< GameObject, MapArchObject, Archetype > arch)
 Calculate the lowest part of this multi-arch. More...
 

Private Attributes

final MultiPositionData multiPositionData
 The MultiPositionData instance to query for multi-part objects. More...
 
int multiShapeID
 The multi-shape ID of the currently parsed archetype. More...
 

Static Private Attributes

static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
 Action Builder. More...
 

Additional Inherited Members

- Public Attributes inherited from net.sf.gridarta.model.io.ArchetypeParser< G, A, R >
String START_ARCH_NAME
 Name of the system-archetype containing path of starting map. More...
 

Detailed Description

Handles the parsing of arches.

It is a class separated from ArchetypeSet because it is also involved in loading arches in map files.

Author
Michael Toennies
Andreas Vogl
Christian Hujer

Definition at line 47 of file ArchetypeParser.java.

Constructor & Destructor Documentation

◆ ArchetypeParser()

net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.ArchetypeParser ( @NotNull final AnimationObjects  animationObjects,
@NotNull final ArchetypeSet< GameObject, MapArchObject, Archetype archetypeSet,
@NotNull final GameObjectFactory< GameObject, MapArchObject, Archetype gameObjectFactory,
@NotNull final MultiPositionData  multiPositionData 
)

Member Function Documentation

◆ addToPanel()

boolean net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.addToPanel ( final boolean  isInternPath,
@NotNull final String  editorFolder,
@NotNull final Archetype  archetype 
)
protected

◆ calculateLowestMulti()

void net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.calculateLowestMulti ( final net.sf.gridarta.model.archetype.Archetype< GameObject, MapArchObject, Archetype arch)
private

Calculate the lowest part of this multi-arch.

This lowest part is needed because in ISO view, the big image is drawn for it's lowest part, in order to get the overlapping correct.

Parameters
archlast tail part of this multi

Definition at line 151 of file ArchetypeParser.java.

References arch, net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMultiPartNr(), net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMultiShapeID(), net.sf.gridarta.model.gameobject.MultiPositionData.getYOffset(), and net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.multiPositionData.

Referenced by net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.finishParseArchetype().

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

◆ finishParseArchetype()

void net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.finishParseArchetype ( @NotNull final Archetype  archetype)
protected

Definition at line 131 of file ArchetypeParser.java.

References net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.calculateLowestMulti().

+ Here is the call graph for this function:

◆ finishParseArchetypePart()

void net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.finishParseArchetypePart ( @Nullable final Archetype  firstArch,
@NotNull final Archetype  archetype,
@NotNull final ErrorViewCollector  errorViewCollector 
)
protected

◆ initParseArchetype()

void net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.initParseArchetype ( )
protected

◆ isStartLine()

boolean net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.isStartLine ( @NotNull final String  line)
protected

Returns whether a give input line denotes the start of a new archetype.

Parameters
linethe input line
Returns
whether the line is a start line

Reimplemented from net.sf.gridarta.model.io.AbstractArchetypeParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, B extends AbstractArchetypeBuilder< G, A, R >.

Definition at line 85 of file ArchetypeParser.java.

◆ processLine()

boolean net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.processLine ( @NotNull final BufferedReader  in,
@NotNull final String  line,
@NotNull final String  line2,
@NotNull final DefaultArchetypeBuilder  archetypeBuilder,
@NotNull final ErrorViewCollector  errorViewCollector,
@NotNull final List< GameObject invObjects 
)
protected

Member Data Documentation

◆ ACTION_BUILDER

final ActionBuilder net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder("net.sf.gridarta")
staticprivate

◆ multiPositionData

final MultiPositionData net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.multiPositionData
private

◆ multiShapeID

int net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.multiShapeID
private

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