 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.validation;
22 import java.util.ArrayList;
23 import java.util.Collection;
24 import java.util.Iterator;
30 import org.jetbrains.annotations.NotNull;
36 public class DelegatingMapValidator<G
extends GameObject<G, A, R>, A extends
MapArchObject<A>, R extends
Archetype<G, A, R>> extends
AbstractValidator<G, A, R> implements
GameObjectValidator<G, A, R>,
SquareValidator<G, A, R>,
MapValidator<G, A, R>, Iterable<Validator<G, A, R>> {
42 private final Collection<Validator<G, A, R>>
validators =
new ArrayList<>();
76 for (
final G archObject : mapSquare) {
78 for (
final G invObject : archObject.recursive()) {
83 mapModel.setErrors(errorCollector);
89 if (validator.isEnabled()) {
A MapModel reflects the data of a map.
DelegatingMapValidator(@NotNull final ValidatorPreferences validatorPreferences, @NotNull final String key)
Creates a new instance for a specific key.
Base package of all Gridarta classes.
Interface for Square Validators.
Iterator< Validator< G, A, R > > iterator()
Reflects a game object (object on a map).
final ValidatorPreferences validatorPreferences
The ValidatorPreferences to use.
Interface for Map Validators.
Configuration parameters for Validators.
GameObjects are the objects based on Archetypes found on maps.
void validateGameObject(@NotNull final G gameObject, @NotNull final ErrorCollector< G, A, R > errorCollector)
void validateSquare(@NotNull final MapSquare< G, A, R > mapSquare, @NotNull final ErrorCollector< G, A, R > errorCollector)
Interface for MapArchObjects.
This is the base class for validators.
void validateAll(@NotNull final MapModel< G, A, R > mapModel)
Performs all validations on a map.
DelegatingMapValidator(@NotNull final ValidatorPreferences validatorPreferences)
Creates a new instance for the default key.
void addValidator(@NotNull final Validator< G, A, R > validator)
Adds a Validator that might to be queried.
Interface for GameObject Validators.
Simple error collector that just collects the error in a collection for later retrieval through itera...
void validateMap(@NotNull final MapModel< G, A, R > mapModel, @NotNull final ErrorCollector< G, A, R > errorCollector)
A Map Validator that delegates to other MapValidators.
final Collection< Validator< G, A, R > > validators
Map Validators to validate against.
static final String DEFAULT_KEY
The default key.