 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.validation.checks;
22 import java.util.HashMap;
34 import org.jetbrains.annotations.NotNull;
41 public class DoubleLayerChecker<G
extends GameObject<G, A, R>, A extends
MapArchObject<A>, R extends
Archetype<G, A, R>> extends
AbstractValidator<G, A, R> implements
SquareValidator<G, A, R> {
53 final Map<Integer, G> gameObjects =
new HashMap<>();
54 final Map<Integer, DoubleLayerError<G, A, R>>
errors =
new HashMap<>();
55 for (
final G gameObject : mapSquare) {
61 if (existingError ==
null) {
62 final G existingGameObject = gameObjects.get(layer);
63 if (existingGameObject ==
null) {
64 gameObjects.put(layer, gameObject);
68 errorCollector.collect(error);
Default implementation for GameObject implementing classes.
Base package of all Gridarta classes.
Interface for Square Validators.
DoubleLayerChecker(@NotNull final ValidatorPreferences validatorPreferences)
Creates a new instance.
Reflects a game object (object on a map).
final ValidatorPreferences validatorPreferences
The ValidatorPreferences to use.
Configuration parameters for Validators.
GameObjects are the objects based on Archetypes found on maps.
A SquareValidator to assert that there are no two objects within the same layer.
Interface for MapArchObjects.
An interface for classes that collect errors.
This is the base class for validators.
This package contains the framework for validating maps.
void validateSquare(@NotNull final MapSquare< G, A, R > mapSquare, @NotNull final ErrorCollector< G, A, R > errorCollector)
Validate a map square.
static final String LAYER
The name of the "layer" attribute.
void addGameObject(@NotNull final G gameObject)
Validation error that's used when the DoubleLayerChecker detected a possible error on the map.