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(@NotNull ValidatorPreferences validatorPreferences)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(@NotNull GameObjectMatcher matcher,
@NotNull java.lang.String name,
@NotNull java.lang.String displayName,
int minValue,
int maxValue)
Adds an attribute to check.
|
void |
add(int type,
@NotNull java.lang.String name,
@NotNull java.lang.String displayName,
int minValue,
int maxValue)
Adds an attribute 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 AttributeRangeChecker(@NotNull @NotNull ValidatorPreferences validatorPreferences)
validatorPreferences
- the validator preferences to usepublic void add(int type, @NotNull @NotNull java.lang.String name, @NotNull @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 @NotNull GameObjectMatcher matcher, @NotNull @NotNull java.lang.String name, @NotNull @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 @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