Class AbstractResourcesReader<G extends GameObject<G,​?,​?>>

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractResourcesReader​(@NotNull java.io.File collectedDirectory, @Nullable java.lang.String imageSet, @NotNull AnimationObjects animationObjects, @NotNull FaceObjects faceObjects)
      Creates a new instance.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addPNGFace​(@NotNull java.lang.String filename, @NotNull java.lang.String path, @NotNull java.lang.String name, @NotNull ErrorView errorView, @NotNull ArchFaceProvider archFaceProvider)
      Loads a png from the file, convert it to IconImage and attach it to the face list.
      protected void loadAnimationsFromCollect​(@NotNull ErrorView errorView, @NotNull java.util.Map<java.lang.String,​java.lang.String> animations, @NotNull AbstractAnimationObjectsReader animationObjectsReader)
      Loads all animations from the big collected animations file.
      protected static @NotNull java.util.Map<java.lang.String,​java.lang.String> loadAnimTree​(@NotNull java.net.URL url)
      Loads animations from a file.
      abstract @NotNull FaceProvider read​(@NotNull ErrorView errorView, @NotNull java.util.List<G> invObjects)
      Reads the resources.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractResourcesReader

        protected AbstractResourcesReader​(@NotNull
                                          @NotNull java.io.File collectedDirectory,
                                          @Nullable
                                          @Nullable java.lang.String imageSet,
                                          @NotNull
                                          @NotNull AnimationObjects animationObjects,
                                          @NotNull
                                          @NotNull FaceObjects faceObjects)
        Creates a new instance.
        Parameters:
        collectedDirectory - the collected directory
        imageSet - the active image set or null
        animationObjects - the animation objects instance
        faceObjects - the face objects instance
    • Method Detail

      • loadAnimationsFromCollect

        protected void loadAnimationsFromCollect​(@NotNull
                                                 @NotNull ErrorView errorView,
                                                 @NotNull
                                                 @NotNull java.util.Map<java.lang.String,​java.lang.String> animations,
                                                 @NotNull
                                                 @NotNull AbstractAnimationObjectsReader animationObjectsReader)
        Loads all animations from the big collected animations file.
        Parameters:
        errorView - the error view for reporting errors
        animations - maps animation name to animation path
        animationObjectsReader - the animation objects reader instance to use
      • addPNGFace

        protected void addPNGFace​(@NotNull
                                  @NotNull java.lang.String filename,
                                  @NotNull
                                  @NotNull java.lang.String path,
                                  @NotNull
                                  @NotNull java.lang.String name,
                                  @NotNull
                                  @NotNull ErrorView errorView,
                                  @NotNull
                                  @NotNull ArchFaceProvider archFaceProvider)
        Loads a png from the file, convert it to IconImage and attach it to the face list.
        Parameters:
        filename - the filename, an absolute path
        path - the path name of name
        name - the name of the png (e.g. blocked.111.png)
        errorView - the error view to use
        archFaceProvider - the arch face provider to add to
      • read

        @NotNull
        public abstract @NotNull FaceProvider read​(@NotNull
                                                   @NotNull ErrorView errorView,
                                                   @NotNull
                                                   @NotNull java.util.List<G> invObjects)
        Reads the resources.
        Parameters:
        errorView - the error view for reporting problems
        invObjects - all read archetypes are added to this list
        Returns:
        the face provider for accessing the read faces
      • loadAnimTree

        @NotNull
        protected static @NotNull java.util.Map<java.lang.String,​java.lang.String> loadAnimTree​(@NotNull
                                                                                                      @NotNull java.net.URL url)
                                                                                               throws java.io.IOException
        Loads animations from a file.
        Parameters:
        url - the URL to load animations tree from
        Returns:
        a map from animation name to animation path
        Throws:
        java.io.IOException - in case of I/O errors
        java.io.FileNotFoundException - in case the file couldn't be opened