Class SlayingChecker<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.model.validation.AbstractValidator<G,A,R>
-
- net.sf.gridarta.model.validation.checks.SlayingChecker<G,A,R>
-
- All Implemented Interfaces:
GameObjectValidator<G,A,R>,Validator<G,A,R>
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>
A GameObjectValidator to assert that game objects do not have critical slaying strings.
-
-
Constructor Summary
Constructors Constructor Description SlayingChecker(@NotNull ValidatorPreferences validatorPreferences, @NotNull java.util.regex.Pattern defaultRegex)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMatcher(@NotNull GameObjectMatcher gameObjectMatcher, @NotNull java.util.regex.Pattern regex)Adds a matcher to check.voidvalidateGameObject(G gameObject, @NotNull ErrorCollector<G,A,R> errorCollector)Validates a game object.-
Methods inherited from class net.sf.gridarta.model.validation.AbstractValidator
getKey, isDefaultEnabled, isEnabled, setEnabled
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.gridarta.model.validation.Validator
getKey, isDefaultEnabled, isEnabled, setEnabled
-
-
-
-
Constructor Detail
-
SlayingChecker
public SlayingChecker(@NotNull @NotNull ValidatorPreferences validatorPreferences, @NotNull @NotNull java.util.regex.Pattern defaultRegex)Creates a new instance.- Parameters:
validatorPreferences- the validator preferences to usedefaultRegex- the regular expression for any "slaying" field not matching any specific game object
-
-
Method Detail
-
addMatcher
public void addMatcher(@NotNull @NotNull GameObjectMatcher gameObjectMatcher, @NotNull @NotNull java.util.regex.Pattern regex)Adds a matcher to check.- Parameters:
gameObjectMatcher- selects the game objects to checkregex- the allowed values of the "slaying" field
-
validateGameObject
public void validateGameObject(@NotNull G gameObject, @NotNull @NotNull ErrorCollector<G,A,R> errorCollector)Description copied from interface:GameObjectValidatorValidates a game object.- Specified by:
validateGameObjectin interfaceGameObjectValidator<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
gameObject- the game object to validateerrorCollector- the error collector to report errors to
-
-