public abstract class AbstractResourcesReader<G extends GameObject<G,?,?>>
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
AbstractResourcesReader(@NotNull java.io.File collectedDirectory,
@Nullable java.lang.String imageSet,
@NotNull AnimationObjects animationObjects,
@NotNull FaceObjects faceObjects)
Creates a new instance.
|
Modifier and Type | Method and 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)
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.
|
protected AbstractResourcesReader(@NotNull @NotNull java.io.File collectedDirectory, @Nullable @Nullable java.lang.String imageSet, @NotNull @NotNull AnimationObjects animationObjects, @NotNull @NotNull FaceObjects faceObjects)
collectedDirectory
- the collected directoryimageSet
- the active image set or null
animationObjects
- the animation objects instancefaceObjects
- the face objects instanceprotected void loadAnimationsFromCollect(@NotNull @NotNull ErrorView errorView, @NotNull @NotNull java.util.Map<java.lang.String,java.lang.String> animations)
errorView
- the error view for reporting errorsanimations
- maps animation name to animation pathprotected 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)
filename
- the filename, an absolute pathpath
- the path name of name
name
- the name of the png (e.g. blocked.111.png)errorView
- the error view to usearchFaceProvider
- the arch face provider to add to@NotNull public abstract @NotNull FaceProvider read(@NotNull @NotNull ErrorView errorView, @NotNull @NotNull java.util.List<G> invObjects)
errorView
- the error view for reporting problemsinvObjects
- all read archetypes are added to this list@NotNull protected static @NotNull java.util.Map<java.lang.String,java.lang.String> loadAnimTree(@NotNull @NotNull java.net.URL url) throws java.io.IOException
url
- the URL to load animations tree fromjava.io.IOException
- in case of I/O errorsjava.io.FileNotFoundException
- in case the file couldn't be opened