public class ArchetypeParser extends AbstractArchetypeParser<GameObject,MapArchObject,Archetype,DefaultArchetypeBuilder>
START_ARCH_NAME
Constructor and Description |
---|
ArchetypeParser(GameObjectParser<GameObject,MapArchObject,Archetype> gameObjectParser,
AnimationObjects animationObjects,
ArchetypeSet<GameObject,MapArchObject,Archetype> archetypeSet,
GameObjectFactory<GameObject,MapArchObject,Archetype> gameObjectFactory,
SmoothFaces smoothFaces)
Creates an ArchetypeParser.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
addToPanel(boolean isInternPath,
java.lang.String editorFolder,
Archetype archetype)
Returns whether an archetype should be added to the archetype chooser.
|
protected void |
finishParseArchetype(Archetype archetype)
Called after all parts of an archetype have been processed.
|
protected void |
finishParseArchetypePart(Archetype firstArch,
Archetype archetype,
ErrorViewCollector errorViewCollector)
Called after the "end" line of a part has been read.
|
protected void |
initParseArchetype()
Called when a new archetype starts.
|
protected boolean |
isStartLine(java.lang.String line)
Returns whether a give input line denotes the start of a new archetype.
|
protected boolean |
processLine(java.io.BufferedReader in,
java.lang.String line,
java.lang.String line2,
DefaultArchetypeBuilder archetypeBuilder,
ErrorViewCollector errorViewCollector,
java.util.List<GameObject> invObjects)
Called for each processed line.
|
parseArchetypeFromStream
public ArchetypeParser(@NotNull GameObjectParser<GameObject,MapArchObject,Archetype> gameObjectParser, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeSet<GameObject,MapArchObject,Archetype> archetypeSet, @NotNull GameObjectFactory<GameObject,MapArchObject,Archetype> gameObjectFactory, @NotNull SmoothFaces smoothFaces)
gameObjectParser
- the game object parser instance to useanimationObjects
- the animation objects instance to usearchetypeSet
- the archetype setgameObjectFactory
- the factory for creating game objectssmoothFaces
- the smooth faces instance to updateprotected void initParseArchetype()
initParseArchetype
in class AbstractArchetypeParser<GameObject,MapArchObject,Archetype,DefaultArchetypeBuilder>
protected boolean isStartLine(@NotNull java.lang.String line)
isStartLine
in class AbstractArchetypeParser<GameObject,MapArchObject,Archetype,DefaultArchetypeBuilder>
line
- the input lineprotected boolean processLine(@NotNull java.io.BufferedReader in, @NotNull java.lang.String line, @NotNull java.lang.String line2, @NotNull DefaultArchetypeBuilder archetypeBuilder, @NotNull ErrorViewCollector errorViewCollector, @NotNull java.util.List<GameObject> invObjects) throws java.io.IOException
processLine
in class AbstractArchetypeParser<GameObject,MapArchObject,Archetype,DefaultArchetypeBuilder>
in
- the reader reading the archetype definitionline
- the input lineline2
- the tripped input linearchetypeBuilder
- the archetype builder for the current archetypeerrorViewCollector
- the error view collector for reporting errorsinvObjects
- the inventory objects of the current archetypejava.io.IOException
- if an I/O error occursprotected void finishParseArchetypePart(@Nullable Archetype firstArch, @NotNull Archetype archetype, @NotNull ErrorViewCollector errorViewCollector)
finishParseArchetypePart
in class AbstractArchetypeParser<GameObject,MapArchObject,Archetype,DefaultArchetypeBuilder>
firstArch
- the head part or null
if archetype
is
the head partarchetype
- the tail parterrorViewCollector
- the error view collector for reporting errorsprotected void finishParseArchetype(@NotNull Archetype archetype)
finishParseArchetype
in class AbstractArchetypeParser<GameObject,MapArchObject,Archetype,DefaultArchetypeBuilder>
archetype
- the archetypeprotected boolean addToPanel(boolean isInternPath, @NotNull java.lang.String editorFolder, @NotNull Archetype archetype)
addToPanel
in class AbstractArchetypeParser<GameObject,MapArchObject,Archetype,DefaultArchetypeBuilder>
isInternPath
- whether the archetype's path contains "/intern/"editorFolder
- the editor_folder attributearchetype
- the archetype to add