Class ArtifactParser<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<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.Object
    Parser for artifact definitions.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull java.util.Collection<G> getInvObjects()
      Returns all collected inventory objects.
      void loadArchesFromArtifacts​(@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.
      void loadArtifact​(@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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 archetypes
        errorView - the error view for reporting errors
        archetypeParser - 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 server
        panelName - the panel to add artifacts to
        folderName - 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.IOException
        Loads one artifact.
        Parameters:
        in - the reader to read from
        errorViewCollector - the error view collector for reporting errors
        archPath - the archetype path
        panelName - the panel to add artifacts to
        folderName - the folder to add artifacts to
        Throws:
        java.io.IOException - if the artifact file cannot be read