public class AttributeRangeChecker<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 |
|---|
AttributeRangeChecker(ValidatorPreferences validatorPreferences)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(GameObjectMatcher matcher,
java.lang.String name,
java.lang.String displayName,
int minValue,
int maxValue)
Adds an attribute to check.
|
void |
add(int type,
java.lang.String name,
java.lang.String displayName,
int minValue,
int maxValue)
Adds an attribute to check.
|
void |
validateGameObject(G gameObject,
ErrorCollector<G,A,R> errorCollector)
Validates a game object.
|
getKey, isDefaultEnabled, isEnabled, setEnabledclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetKey, isDefaultEnabled, isEnabled, setEnabledpublic AttributeRangeChecker(@NotNull
ValidatorPreferences validatorPreferences)
validatorPreferences - the validator preferences to usepublic void add(int type,
@NotNull
java.lang.String name,
@NotNull
java.lang.String displayName,
int minValue,
int maxValue)
throws InvalidCheckException
type - the object type to checkname - the attribute name to checkdisplayName - the description for error messagesminValue - the minimum expected valuemaxValue - the maximum expected valueInvalidCheckException - if the check is invalidpublic void add(@NotNull
GameObjectMatcher matcher,
@NotNull
java.lang.String name,
@NotNull
java.lang.String displayName,
int minValue,
int maxValue)
throws InvalidCheckException
matcher - the game object matchername - the attribute name to checkdisplayName - the description for error messagesminValue - the minimum expected valuemaxValue - the maximum expected valueInvalidCheckException - if the check is invalidpublic 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 to