20 package net.sf.gridarta.plugin.parameter;
25 import org.jetbrains.annotations.NotNull;
42 private int min = Integer.MIN_VALUE;
47 private int max = Integer.MAX_VALUE;
59 return visitor.visit(
this);
66 intValue = Integer.parseInt(stringValue);
67 }
catch (
final NumberFormatException ignored) {
76 super.setValue(intValue);
83 super.setValue(Math.max(Math.min(value, max),
min));
111 final int newMax = Math.max(min, max);
112 if (this.max == newMax) {
135 final int newMin = Math.min(min, max);
136 if (this.min == newMin) {
int getMin()
Returns the minimal allowed value.
IntegerParameter()
Creates a new instance.
int min
The minimal allowed value.
boolean setStringValue(@NotNull final String stringValue)
static final String PARAMETER_TYPE
The string representation of this parameter type.
A PluginParameter that holds an integer value and a range of valid values.
int max
The maximal allowed value.
void setMin(final int min)
Sets the minimal allowed value.
Abstract base class for PluginParameter implementations for which the string representation of the va...
Base package of all Gridarta classes.
V value
The current value.
Reflects a game object (object on a map).
GameObjects are the objects based on Archetypes found on maps.
Interface for visitors of PluginParameter instances.
String getParameterType()
void setMax(final int max)
Sets the maximal allowed value.
int getMax()
Returns the maximal allowed value.
void setValue(@NotNull final Integer value)
Interface for MapArchObjects.