Package net.sf.gridarta.model.artifact
Class ArtifactParser<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.model.artifact.ArtifactParser<G,A,R>
-
public class ArtifactParser<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.ObjectParser for artifact definitions.
-
-
Constructor Summary
Constructors Constructor Description ArtifactParser(@NotNull ArchetypeSet<G,A,R> archetypeSet, @NotNull ErrorView errorView, @NotNull AbstractArchetypeParser<G,A,R,?> archetypeParser)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull java.util.Collection<G>getInvObjects()Returns all collected inventory objects.voidloadArchesFromArtifacts(@NotNull java.io.File f, @NotNull java.lang.String panelName, @NotNull java.lang.String folderName)This method takes a filename or directory name as argument.voidloadArtifact(@NotNull java.io.BufferedReader in, @NotNull ErrorViewCollector errorViewCollector, @NotNull java.lang.String archPath, @NotNull java.lang.String panelName, @NotNull java.lang.String folderName)Loads one artifact.
-
-
-
Constructor Detail
-
ArtifactParser
public ArtifactParser(@NotNull @NotNull ArchetypeSet<G,A,R> archetypeSet, @NotNull @NotNull ErrorView errorView, @NotNull @NotNull AbstractArchetypeParser<G,A,R,?> archetypeParser)Creates a new instance.- Parameters:
archetypeSet- the archetype set for looking up archetypeserrorView- the error view for reporting errorsarchetypeParser- the archetype parser to use
-
-
Method Detail
-
getInvObjects
@NotNull public @NotNull java.util.Collection<G> getInvObjects()
Returns all collected inventory objects.- Returns:
- the collected inventory objects
-
loadArchesFromArtifacts
public void loadArchesFromArtifacts(@NotNull @NotNull java.io.File f, @NotNull @NotNull java.lang.String panelName, @NotNull @NotNull java.lang.String folderName)This method takes a filename or directory name as argument. In case of a directory it is recursively traversed and all artifact files (*.art) get parsed.- Parameters:
f- This can be a filename or a directory name Load "pseudo arches" from file "artifacts" WARNING: Don't include multi arches in the artifacts file This code can't handle it nor the real serverpanelName- the panel to add artifacts tofolderName- the folder to add artifacts to
-
loadArtifact
public void loadArtifact(@NotNull @NotNull java.io.BufferedReader in, @NotNull @NotNull ErrorViewCollector errorViewCollector, @NotNull @NotNull java.lang.String archPath, @NotNull @NotNull java.lang.String panelName, @NotNull @NotNull java.lang.String folderName) throws java.io.IOExceptionLoads one artifact.- Parameters:
in- the reader to read fromerrorViewCollector- the error view collector for reporting errorsarchPath- the archetype pathpanelName- the panel to add artifacts tofolderName- the folder to add artifacts to- Throws:
java.io.IOException- if the artifact file cannot be read
-
-