Class AttributeRangeChecker<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>

    • Constructor Detail

      • AttributeRangeChecker

        public AttributeRangeChecker​(@NotNull
                                     @NotNull ValidatorPreferences validatorPreferences)
        Creates a new instance.
        Parameters:
        validatorPreferences - the validator preferences to use
    • Method Detail

      • add

        public void add​(int type,
                        @NotNull
                        @NotNull java.lang.String name,
                        @NotNull
                        @NotNull java.lang.String displayName,
                        int minValue,
                        int maxValue)
                 throws InvalidCheckException
        Adds an attribute to check. The validator generates an error if the attribute value is outside the given value range.
        Parameters:
        type - the object type to check
        name - the attribute name to check
        displayName - the description for error messages
        minValue - the minimum expected value
        maxValue - the maximum expected value
        Throws:
        InvalidCheckException - if the check is invalid
      • add

        public void add​(@NotNull
                        @NotNull GameObjectMatcher matcher,
                        @NotNull
                        @NotNull java.lang.String name,
                        @NotNull
                        @NotNull java.lang.String displayName,
                        int minValue,
                        int maxValue)
                 throws InvalidCheckException
        Adds an attribute to check. The validator generates an error if the attribute value is outside the given value range.
        Parameters:
        matcher - the game object matcher
        name - the attribute name to check
        displayName - the description for error messages
        minValue - the minimum expected value
        maxValue - the maximum expected value
        Throws:
        InvalidCheckException - if the check is invalid