public abstract class AbstractResources<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractResources(@NotNull GameObjectParser<G,A,R> gameObjectParser,
@NotNull ArchetypeSet<G,A,R> archetypeSet)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canWriteCollected()
Whether the resources can be written in collected form.
|
void |
readCollected(@NotNull ProjectSettings projectSettings,
@NotNull ErrorView errorView)
Reads the resources from a collection.
|
protected abstract @NotNull java.util.List<G> |
readCollectedInt(@NotNull ProjectSettings projectSettings,
@NotNull ErrorView errorView)
Reads the resources from a collection.
|
void |
readFiles(@NotNull ProjectSettings projectSettings,
@NotNull ErrorView errorView)
Reads the resources from individual files.
|
protected abstract void |
readFilesInt(@NotNull ProjectSettings projectSettings,
@NotNull ErrorView errorView,
@NotNull java.util.List<G> invObjects)
Reads the resources from individual files.
|
void |
writeCollected(@NotNull net.sf.japi.swing.misc.Progress progress,
@NotNull java.io.File collectedDirectory)
Writes the resources in collected form.
|
protected abstract void |
writeCollectedInt(@NotNull net.sf.japi.swing.misc.Progress progress,
@NotNull java.io.File collectedDirectory)
Writes the resources in collected form.
|
protected AbstractResources(@NotNull
@NotNull GameObjectParser<G,A,R> gameObjectParser,
@NotNull
@NotNull ArchetypeSet<G,A,R> archetypeSet)
gameObjectParser - the game object parser to usearchetypeSet - the archetype set to updatepublic void readFiles(@NotNull
@NotNull ProjectSettings projectSettings,
@NotNull
@NotNull ErrorView errorView)
projectSettings - the project settings to read fromerrorView - the error view for reporting problemspublic void readCollected(@NotNull
@NotNull ProjectSettings projectSettings,
@NotNull
@NotNull ErrorView errorView)
projectSettings - the project settings to read fromerrorView - the error view for reporting problemspublic boolean canWriteCollected()
true when loaded with readFiles; false when loaded with readCollected()public void writeCollected(@NotNull
@NotNull net.sf.japi.swing.misc.Progress progress,
@NotNull
@NotNull java.io.File collectedDirectory)
throws java.io.IOException
progress - the progress to usecollectedDirectory - the collected directory to write tojava.io.IOException - if collection failsjava.lang.IllegalStateException - if canWriteCollected() returns
falseprotected abstract void readFilesInt(@NotNull
@NotNull ProjectSettings projectSettings,
@NotNull
@NotNull ErrorView errorView,
@NotNull
@NotNull java.util.List<G> invObjects)
projectSettings - the project settings to read fromerrorView - the error view for reporting problemsinvObjects - all read archetypes@NotNull protected abstract @NotNull java.util.List<G> readCollectedInt(@NotNull @NotNull ProjectSettings projectSettings, @NotNull @NotNull ErrorView errorView)
projectSettings - the project settings to read fromerrorView - the error view for reporting problemsprotected abstract void writeCollectedInt(@NotNull
@NotNull net.sf.japi.swing.misc.Progress progress,
@NotNull
@NotNull java.io.File collectedDirectory)
throws java.io.IOException
progress - the progress to usecollectedDirectory - the collected directory to write tojava.io.IOException - if collection fails