20 package net.sf.gridarta.model.io;
22 import java.io.BufferedReader;
24 import java.io.IOException;
25 import java.io.Reader;
26 import java.io.StringReader;
27 import java.util.ArrayList;
28 import java.util.List;
36 import org.jetbrains.annotations.NotNull;
37 import org.junit.Assert;
53 protected void check(@NotNull
final String input,
final boolean hasErrors,
final boolean hasWarnings,
final int archetypes)
throws IOException {
56 final List<G> invObjects =
new ArrayList<>();
57 final Reader reader =
new StringReader(input);
58 try (BufferedReader bufferedReader =
new BufferedReader(reader)) {
61 Assert.assertEquals(hasErrors, errorView.
hasErrors());
62 Assert.assertEquals(hasWarnings, errorView.
hasWarnings());
Convenience class for adding messages to a ErrorView instance using a fixed category name...
Base package of all Gridarta classes.
Reflects a game object (object on a map).
boolean hasErrors
Whether errors have been collected.
GameObjects are the objects based on Archetypes found on maps.
void parseArchetypeFromStream(@NotNull final BufferedReader in, @Nullable final R prototype, @Nullable final String line, @Nullable final String archName, @NotNull final String panelName, @NotNull final String folderName, @NotNull final String archPath, @NotNull final List< G > invObjects, @NotNull final ErrorViewCollector errorViewCollector)
void check(@NotNull final String input, final boolean hasErrors, final boolean hasWarnings, final int archetypes)
Creates a new archetype parser and parses the given input.
abstract AbstractArchetypeParser< G, A, R, ? extends AbstractArchetypeBuilder< G, A, R > > newArchetypeParser()
Creates a new AbstractArchetypeParser instance.
Creates Archetype instances.
abstract ArchetypeSet< G, A, R > getArchetypeSet()
Returns the ArchetypeSet.
Interface that captures similarities between different ArchetypeSet implementations.
boolean hasWarnings
Whether warnings have been collected.
Abstract base class for regression tests for ArchetypeParser.
An ErrorView suitable for unit tests.
Interface for MapArchObjects.