20 package net.sf.gridarta.model.validation.checks;
36 import org.jetbrains.annotations.NotNull;
42 public class TilePathsChecker<G
extends GameObject<G, A, R>, A extends
MapArchObject<A>, R extends
Archetype<G, A, R>> extends
AbstractValidator<G, A, R> implements
MapValidator<G, A, R> {
55 super(validatorPreferences);
63 for (
int direction = 0; direction <
tilePaths; direction++) {
64 final String path = mapArchObject.
getTilePath(directions[direction]);
65 if (!path.isEmpty()) {
68 if (!file.exists() || file.isDirectory()) {
69 errorCollector.collect(
new TilePathsError<>(mapModel, directions[direction], path));
static MapPath newMapPath(@NotNull final String string)
Creates a MapPath instance from string representation.
Exception thrown if the destination path points to the source map.
A MapModel reflects the data of a map.
This is the base class for validators.
This package contains the framework for validating maps.
Interface for Map Validators.
final int tilePaths
The number of tile paths to check.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
Configuration parameters for Validators.
GameObjects are the objects based on Archetypes found on maps.
Utility class for MapPath related functions.
final ValidatorPreferences validatorPreferences
The ValidatorPreferences to use.
Exception thrown if an operation is attempted on an unsaved map.
Validator that checks whether all tile paths are valid.
TilePathsChecker(@NotNull final ValidatorPreferences validatorPreferences, final int tilePaths)
Create a TilePathsChecker.
An interface for classes that collect errors.
Validation error that's used when a map has wrong tile paths.
String getTilePath(@NotNull Direction direction)
Returns a tile path.
Interface for MapArchObjects.
void validateMap(@NotNull final MapModel< G, A, R > mapModel, @NotNull final ErrorCollector< G, A, R > errorCollector)
Validate a map.