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>, java.lang.Iterable<Validator<G,A,R>>
Modifier and Type | Field and Description |
---|---|
static @NotNull java.lang.String |
DEFAULT_KEY
The default key.
|
Constructor and Description |
---|
DelegatingMapValidator(@NotNull ValidatorPreferences validatorPreferences)
Creates a new instance for the default key.
|
Modifier and Type | Method and Description |
---|---|
void |
addValidator(@NotNull Validator<G,A,R> validator)
Adds a
Validator that might to be queried. |
@NotNull java.util.Iterator<Validator<G,A,R>> |
iterator() |
void |
validateAll(@NotNull MapModel<G,A,R> mapModel)
Performs all validations on a map.
|
void |
validateGameObject(G gameObject,
@NotNull ErrorCollector<G,A,R> errorCollector)
Validates a game object.
|
void |
validateMap(@NotNull MapModel<G,A,R> mapModel,
@NotNull ErrorCollector<G,A,R> errorCollector)
Validate a map.
|
void |
validateSquare(@NotNull MapSquare<G,A,R> mapSquare,
@NotNull ErrorCollector<G,A,R> errorCollector)
Validate a map square.
|
getKey, isDefaultEnabled, isEnabled, setEnabled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getKey, isDefaultEnabled, isEnabled, setEnabled
@NotNull public static final @NotNull java.lang.String DEFAULT_KEY
public DelegatingMapValidator(@NotNull @NotNull ValidatorPreferences validatorPreferences)
validatorPreferences
- the validator preferences to usepublic void validateAll(@NotNull @NotNull MapModel<G,A,R> mapModel)
mapModel
- map to validatepublic void validateMap(@NotNull @NotNull MapModel<G,A,R> mapModel, @NotNull @NotNull ErrorCollector<G,A,R> errorCollector)
MapValidator
validateMap
in interface MapValidator<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
mapModel
- Map to validateerrorCollector
- Error collector to report errors topublic void validateSquare(@NotNull @NotNull MapSquare<G,A,R> mapSquare, @NotNull @NotNull ErrorCollector<G,A,R> errorCollector)
SquareValidator
validateSquare
in interface SquareValidator<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
mapSquare
- Square to validateerrorCollector
- Error collector to report errors topublic void validateGameObject(@NotNull G gameObject, @NotNull @NotNull ErrorCollector<G,A,R> errorCollector)
GameObjectValidator
validateGameObject
in interface GameObjectValidator<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
gameObject
- the game object to validateerrorCollector
- the error collector to report errors topublic void addValidator(@NotNull @NotNull Validator<G,A,R> validator)
Validator
that might to be queried. The validator is
queried for a KeyName and the preferences are queried whether this
validator module should or shouldn't be active.validator
- to be queried