public class ArchetypeParser extends AbstractArchetypeParser<GameObject,MapArchObject,Archetype,DefaultArchetypeBuilder>
START_ARCH_NAME| Constructor and Description |
|---|
ArchetypeParser(@NotNull AnimationObjects animationObjects,
@NotNull ArchetypeSet<GameObject,MapArchObject,Archetype> archetypeSet,
@NotNull GameObjectFactory<GameObject,MapArchObject,Archetype> gameObjectFactory,
@NotNull MultiPositionData multiPositionData)
Creates an ArchetypeParser.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
addToPanel(boolean isInternPath,
@NotNull java.lang.String editorFolder,
@NotNull Archetype archetype)
Returns whether an archetype should be added to the archetype chooser.
|
protected void |
finishParseArchetype(@NotNull Archetype archetype)
Called after all parts of an archetype have been processed.
|
protected void |
finishParseArchetypePart(@Nullable Archetype firstArch,
@NotNull Archetype archetype,
@NotNull 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(@NotNull java.lang.String line)
Returns whether a give input line denotes the start of a new archetype.
|
protected 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)
Called for each processed line.
|
parseArchetypeFromStreampublic ArchetypeParser(@NotNull
@NotNull AnimationObjects animationObjects,
@NotNull
@NotNull ArchetypeSet<GameObject,MapArchObject,Archetype> archetypeSet,
@NotNull
@NotNull GameObjectFactory<GameObject,MapArchObject,Archetype> gameObjectFactory,
@NotNull
@NotNull MultiPositionData multiPositionData)
animationObjects - the animation objects instance to usearchetypeSet - the archetype setgameObjectFactory - the factory for creating game objectsmultiPositionData - the multi position data to query for multi-part
objectsprotected void initParseArchetype()
AbstractArchetypeParserinitParseArchetype in class AbstractArchetypeParser<GameObject,MapArchObject,Archetype,DefaultArchetypeBuilder>protected boolean isStartLine(@NotNull
@NotNull java.lang.String line)
AbstractArchetypeParserisStartLine in class AbstractArchetypeParser<GameObject,MapArchObject,Archetype,DefaultArchetypeBuilder>line - the input lineprotected boolean processLine(@NotNull
@NotNull java.io.BufferedReader in,
@NotNull
@NotNull java.lang.String line,
@NotNull
@NotNull java.lang.String line2,
@NotNull
@NotNull DefaultArchetypeBuilder archetypeBuilder,
@NotNull
@NotNull ErrorViewCollector errorViewCollector,
@NotNull
@NotNull java.util.List<GameObject> invObjects)
AbstractArchetypeParserprocessLine 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 archetypeprotected void finishParseArchetypePart(@Nullable
@Nullable Archetype firstArch,
@NotNull
@NotNull Archetype archetype,
@NotNull
@NotNull ErrorViewCollector errorViewCollector)
AbstractArchetypeParserfinishParseArchetypePart 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
@NotNull Archetype archetype)
AbstractArchetypeParserfinishParseArchetype in class AbstractArchetypeParser<GameObject,MapArchObject,Archetype,DefaultArchetypeBuilder>archetype - the archetypeprotected boolean addToPanel(boolean isInternPath,
@NotNull
@NotNull java.lang.String editorFolder,
@NotNull
@NotNull Archetype archetype)
AbstractArchetypeParseraddToPanel in class AbstractArchetypeParser<GameObject,MapArchObject,Archetype,DefaultArchetypeBuilder>isInternPath - whether the archetype's path contains "/intern/"editorFolder - the editor_folder attributearchetype - the archetype to add