Gridarta Editor
net.sf.gridarta.model.resource.AbstractFilesResourcesReader< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R > Class Template Referenceabstract

Abstract base class for AbstractResourcesReaders that read from individual files. More...

+ Inheritance diagram for net.sf.gridarta.model.resource.AbstractFilesResourcesReader< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
+ Collaboration diagram for net.sf.gridarta.model.resource.AbstractFilesResourcesReader< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:

Public Member Functions

FaceProvider read (@NotNull final ErrorView errorView, @NotNull final List< G > invObjects)
 
- Public Member Functions inherited from net.sf.gridarta.model.resource.AbstractResourcesReader< G >
abstract FaceProvider read ( @NotNull ErrorView errorView, @NotNull List< G > invObjects)
 Reads the resources. More...
 

Protected Member Functions

 AbstractFilesResourcesReader (@NotNull final File archDirectory, @NotNull final ArchetypeSet< G, A, R > archetypeSet, @NotNull final AbstractArchetypeParser< G, A, R, ?> archetypeParser, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final File collectedDirectory, @Nullable final String imageSet, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjects faceObjects)
 Creates a new instance. More...
 
abstract boolean isValidEntry (int folderLevel, String name)
 Returns whether a file name should be processed. More...
 
- Protected Member Functions inherited from net.sf.gridarta.model.resource.AbstractResourcesReader< G >
 AbstractResourcesReader ( @NotNull final File collectedDirectory, @Nullable final String imageSet, @NotNull final AnimationObjects animationObjects, @NotNull final FaceObjects faceObjects)
 Creates a new instance. More...
 
void addPNGFace ( @NotNull final String filename, @NotNull final String path, @NotNull final String name, @NotNull final ErrorView errorView, @NotNull final ArchFaceProvider archFaceProvider)
 Loads a png from the file, convert it to IconImage and attach it to the face list. More...
 
void loadAnimationsFromCollect ( @NotNull final ErrorView errorView, @NotNull final Map< String, String > animations)
 Loads all animations from the big collected animations file. More...
 

Private Member Functions

void loadAnimationsFromFiles (@NotNull final ErrorViewCollector errorViewCollector, @NotNull final Iterable< Pair< String, File >> animFiles)
 This method loads animations that are separately defined by looping through all files that were previously collected by AbstractArchetypeParser, String, File, int, String, String, List, ArchFaceProvider, ErrorView, Collection). More...
 
void loadArchetypesFromFiles (@NotNull final ErrorViewCollector errorViewCollector, @NotNull final AbstractArchetypeParser< G, A, R, ?> archetypeParser, @NotNull final String path, @NotNull final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, @NotNull final List< G > invObjects, @NotNull final ArchFaceProvider archFaceProvider, @NotNull final ErrorView errorView, @NotNull final Collection< Pair< String, File >> animFiles)
 Loads all archetypes and faces by recursing through the. More...
 
void parseDefFace (@NotNull final ErrorView errorView, @NotNull final String path, @NotNull final String filename)
 Loads a .face file. More...
 

Private Attributes

final AnimationObjects animationObjects
 The AnimationObjects to use. More...
 
final File archDirectory
 The "arch" directory to read. More...
 
final AbstractArchetypeParser< G, A, R, ?> archetypeParser
 The AbstractArchetypeParser to use. More...
 
final ArchetypeSet< G, A, R > archetypeSet
 The ArchetypeSet to update. More...
 
final ArchFaceProvider archFaceProvider
 The ArchFaceProvider to use. More...
 

Static Private Attributes

static final Category LOG = Logger.getLogger(AbstractFilesResourcesReader.class)
 The logger for printing log messages. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from net.sf.gridarta.model.resource.AbstractResourcesReader< G >
static Map< String, String > loadAnimTree ( @NotNull final URL url) throws IOException
 Loads animations from a file. More...
 

Detailed Description

Abstract base class for AbstractResourcesReaders that read from individual files.

Author
Andreas Kirschbaum

Definition at line 58 of file AbstractFilesResourcesReader.java.

Constructor & Destructor Documentation

◆ AbstractFilesResourcesReader()

net.sf.gridarta.model.resource.AbstractFilesResourcesReader< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.AbstractFilesResourcesReader ( @NotNull final File  archDirectory,
@NotNull final ArchetypeSet< G, A, R >  archetypeSet,
@NotNull final AbstractArchetypeParser< G, A, R, ?>  archetypeParser,
@NotNull final ArchFaceProvider  archFaceProvider,
@NotNull final File  collectedDirectory,
@Nullable final String  imageSet,
@NotNull final AnimationObjects  animationObjects,
@NotNull final FaceObjects  faceObjects 
)
protected

Creates a new instance.

Parameters
archDirectorythe "arch" directory to read
archetypeSetthe archetype set to update
archetypeParserthe archetype parser to use
archFaceProviderthe arch face provider to use
collectedDirectorythe collected directory
imageSetthe active image set or
null
animationObjectsthe animation objects instance
faceObjectsthe face objects instance

Definition at line 106 of file AbstractFilesResourcesReader.java.

Member Function Documentation

◆ isValidEntry()

abstract boolean net.sf.gridarta.model.resource.AbstractFilesResourcesReader< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isValidEntry ( int  folderLevel,
String  name 
)
abstractprotected

Returns whether a file name should be processed.

Parameters
folderLevelthe folder level
namethe base name of the file name
Returns
whether the entry is valid and should be processed

Referenced by net.sf.gridarta.model.resource.AbstractFilesResourcesReader< TestGameObject, TestMapArchObject, TestArchetype >.loadAnimationsFromFiles(), and net.sf.gridarta.model.resource.AbstractFilesResourcesReader< TestGameObject, TestMapArchObject, TestArchetype >.loadArchetypesFromFiles().

+ Here is the caller graph for this function:

◆ loadAnimationsFromFiles()

void net.sf.gridarta.model.resource.AbstractFilesResourcesReader< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.loadAnimationsFromFiles ( @NotNull final ErrorViewCollector  errorViewCollector,
@NotNull final Iterable< Pair< String, File >>  animFiles 
)
private

This method loads animations that are separately defined by looping through all files that were previously collected by AbstractArchetypeParser, String, File, int, String, String, List, ArchFaceProvider, ErrorView, Collection).

Do not invoke this method if

wasn't invoked.

Parameters
errorViewCollectorthe error view collector for reporting errors
animFilesthe animation files

Definition at line 228 of file AbstractFilesResourcesReader.java.

Referenced by net.sf.gridarta.model.resource.AbstractFilesResourcesReader< TestGameObject, TestMapArchObject, TestArchetype >.read().

+ Here is the caller graph for this function:

◆ loadArchetypesFromFiles()

void net.sf.gridarta.model.resource.AbstractFilesResourcesReader< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.loadArchetypesFromFiles ( @NotNull final ErrorViewCollector  errorViewCollector,
@NotNull final AbstractArchetypeParser< G, A, R, ?>  archetypeParser,
@NotNull final String  path,
@NotNull final File  f,
final int  folderLevel,
@NotNull final String  panelName,
@NotNull final String  folderName,
@NotNull final List< G >  invObjects,
@NotNull final ArchFaceProvider  archFaceProvider,
@NotNull final ErrorView  errorView,
@NotNull final Collection< Pair< String, File >>  animFiles 
)
private

Loads all archetypes and faces by recursing through the.

arch

directory tree.

Parameters
errorViewCollectorthe error view collector for reporting errors
archetypeParserthe archetype parser to use
paththe base directory relative path of
f
ffile path where we currently are
folderLevellevel of the folder
panelNamethe panel to add archetypes to
folderNamethe folder to add archetypes to
invObjectscollects all inventory objects
archFaceProviderthe arch face provider to add to
errorViewthe error view to use
animFilesthe found animation files

Definition at line 152 of file AbstractFilesResourcesReader.java.

Referenced by net.sf.gridarta.model.resource.AbstractFilesResourcesReader< TestGameObject, TestMapArchObject, TestArchetype >.loadArchetypesFromFiles(), and net.sf.gridarta.model.resource.AbstractFilesResourcesReader< TestGameObject, TestMapArchObject, TestArchetype >.read().

+ Here is the caller graph for this function:

◆ parseDefFace()

void net.sf.gridarta.model.resource.AbstractFilesResourcesReader< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.parseDefFace ( @NotNull final ErrorView  errorView,
@NotNull final String  path,
@NotNull final String  filename 
)
private

Loads a .face file.

Parameters
errorViewthe error view for reporting errors
paththe base directory relative path of
filename
filenamefilename

Definition at line 201 of file AbstractFilesResourcesReader.java.

Referenced by net.sf.gridarta.model.resource.AbstractFilesResourcesReader< TestGameObject, TestMapArchObject, TestArchetype >.loadArchetypesFromFiles().

+ Here is the caller graph for this function:

◆ read()

FaceProvider net.sf.gridarta.model.resource.AbstractFilesResourcesReader< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.read ( @NotNull final ErrorView  errorView,
@NotNull final List< G >  invObjects 
)

Definition at line 117 of file AbstractFilesResourcesReader.java.

Member Data Documentation

◆ animationObjects

◆ archDirectory

◆ archetypeParser

◆ archetypeSet

◆ archFaceProvider

◆ LOG

final Category net.sf.gridarta.model.resource.AbstractFilesResourcesReader< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.LOG = Logger.getLogger(AbstractFilesResourcesReader.class)
staticprivate

The logger for printing log messages.

Definition at line 63 of file AbstractFilesResourcesReader.java.


The documentation for this class was generated from the following file: