public class SlayingChecker<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>
Constructor and Description |
---|
SlayingChecker(@NotNull ValidatorPreferences validatorPreferences,
@NotNull java.util.regex.Pattern defaultRegex)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addMatcher(@NotNull GameObjectMatcher gameObjectMatcher,
@NotNull java.util.regex.Pattern regex)
Adds a matcher to check.
|
void |
validateGameObject(G gameObject,
@NotNull ErrorCollector<G,A,R> errorCollector)
Validates a game object.
|
getKey, isDefaultEnabled, isEnabled, setEnabled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getKey, isDefaultEnabled, isEnabled, setEnabled
public SlayingChecker(@NotNull @NotNull ValidatorPreferences validatorPreferences, @NotNull @NotNull java.util.regex.Pattern defaultRegex)
validatorPreferences
- the validator preferences to usedefaultRegex
- the regular expression for any "slaying" field not
matching any specific game objectpublic void addMatcher(@NotNull @NotNull GameObjectMatcher gameObjectMatcher, @NotNull @NotNull java.util.regex.Pattern regex)
gameObjectMatcher
- selects the game objects to checkregex
- the allowed values of the "slaying" fieldpublic 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 to