20 package net.sf.gridarta.model.resource;
23 import java.io.IOException;
24 import java.util.ArrayList;
25 import java.util.List;
33 import net.
sf.japi.swing.misc.Progress;
34 import org.jetbrains.annotations.NotNull;
78 private void finishRead(@NotNull
final List<G> invObjects) {
90 throw new IllegalStateException();
92 final List<G> invObjects =
new ArrayList<>();
95 loadedFromFiles =
true;
106 throw new IllegalStateException();
110 loadedFromFiles =
false;
131 public void writeCollected(@NotNull
final Progress progress, @NotNull
final File collectedDirectory)
throws IOException {
133 throw new IllegalStateException();
161 protected abstract void writeCollectedInt(@NotNull Progress progress, @NotNull File collectedDirectory)
throws IOException;
abstract List< G > readCollectedInt(@NotNull ProjectSettings projectSettings, @NotNull ErrorView errorView)
Reads the resources from a collection.
Reading and writing of maps, handling of paths.
Settings that apply to a project.
boolean canWriteCollected()
Whether the resources can be written in collected form.
boolean loaded
Whether the resources have been loaded.
Interface for classes that read or write GameObject instances.
boolean loadedFromFiles
Whether the resources have been loaded from individual files.
void finishRead(@NotNull final List< G > invObjects)
Common code to be executed after reading resources.
Interface for classes displaying error messages.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
void readCollected(@NotNull final ProjectSettings projectSettings, @NotNull final ErrorView errorView)
Reads the resources from a collection.
GameObjects are the objects based on Archetypes found on maps.
final ArchetypeSet< G, A, R > archetypeSet
The ArchetypeSet to update.
abstract void readFilesInt(@NotNull ProjectSettings projectSettings, @NotNull ErrorView errorView, @NotNull List< G > invObjects)
Reads the resources from individual files.
abstract void writeCollectedInt(@NotNull Progress progress, @NotNull File collectedDirectory)
Writes the resources in collected form.
final GameObjectParser< G, A, R > gameObjectParser
The GameObjectParser to use.
void collectTempList(@NotNull List< G > objects)
Browse first through the archetype list and attach map arches to it then browse through the face list...
void readFiles(@NotNull final ProjectSettings projectSettings, @NotNull final ErrorView errorView)
Reads the resources from individual files.
AbstractResources(@NotNull final GameObjectParser< G, A, R > gameObjectParser, @NotNull final ArchetypeSet< G, A, R > archetypeSet)
Creates a new instance.
Interface that captures similarities between different ArchetypeSet implementations.
void writeCollected(@NotNull final Progress progress, @NotNull final File collectedDirectory)
Writes the resources in collected form.
Interface for MapArchObjects.