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 java.lang.String |
DEFAULT_KEY
The default key.
|
Constructor and Description |
---|
DelegatingMapValidator(ValidatorPreferences validatorPreferences)
Create a DelegatingMapValidator for the default key.
|
Modifier and Type | Method and Description |
---|---|
void |
addValidator(Validator<G,A,R> validator)
Add a Validator that might to be queried.
|
java.util.Iterator<Validator<G,A,R>> |
iterator() |
void |
validate(G[] gameObjects,
ErrorCollector<G,A,R> errorCollector)
Validate a set of game objects.
|
void |
validateAll(MapModel<G,A,R> mapModel)
Perform all validations on a map.
|
void |
validateGameObject(G gameObject,
ErrorCollector<G,A,R> errorCollector)
Validates a game object.
|
void |
validateMap(MapModel<G,A,R> mapModel,
ErrorCollector<G,A,R> errorCollector)
Validate a map.
|
void |
validateSquare(MapSquare<G,A,R> mapSquare,
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 java.lang.String DEFAULT_KEY
public DelegatingMapValidator(@NotNull ValidatorPreferences validatorPreferences)
validatorPreferences
- the validator preferences to usepublic void validateAll(@NotNull MapModel<G,A,R> mapModel)
mapModel
- map to validatepublic void validateMap(@NotNull MapModel<G,A,R> mapModel, @NotNull ErrorCollector<G,A,R> errorCollector)
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 MapSquare<G,A,R> mapSquare, @NotNull ErrorCollector<G,A,R> errorCollector)
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 ErrorCollector<G,A,R> errorCollector)
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 validate(@NotNull G[] gameObjects, @NotNull ErrorCollector<G,A,R> errorCollector)
gameObjects
- game objects to validateerrorCollector
- the rror collector to report errors topublic void addValidator(@NotNull Validator<G,A,R> validator)
validator
- to be queried