public abstract class AbstractResourcesReader<G extends GameObject<G,?,?>>
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
AbstractResourcesReader(java.io.File collectedDirectory,
java.lang.String imageSet,
AnimationObjects animationObjects,
FaceObjects faceObjects)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addPNGFace(java.lang.String filename,
java.lang.String path,
java.lang.String name,
ErrorView errorView,
ArchFaceProvider archFaceProvider)
Loads a png from the file, convert it to IconImage and attach it to the
face list.
|
protected void |
loadAnimationsFromCollect(ErrorView errorView,
java.util.Map<java.lang.String,java.lang.String> animations)
Loads all animations from the big collected animations file.
|
protected static java.util.Map<java.lang.String,java.lang.String> |
loadAnimTree(java.net.URL url)
Loads animations from a file.
|
abstract FaceProvider |
read(ErrorView errorView,
java.util.List<G> invObjects)
Reads the resources.
|
protected AbstractResourcesReader(@NotNull java.io.File collectedDirectory, @Nullable java.lang.String imageSet, @NotNull AnimationObjects animationObjects, @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 ErrorView errorView, @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 java.lang.String filename, @NotNull java.lang.String path, @NotNull java.lang.String name, @NotNull ErrorView errorView, @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 FaceProvider read(@NotNull ErrorView errorView, @NotNull java.util.List<G> invObjects)
errorView
- the error view for reporting problemsinvObjects
- all read archetypes are added to this list@NotNull protected static java.util.Map<java.lang.String,java.lang.String> loadAnimTree(@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