 |
Gridarta Editor
|
Go to the documentation of this file.
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 getMax()
Returns the maximal allowed value.
String getParameterType()
Base package of all Gridarta classes.
int min
The minimal allowed value.
A PluginParameter that holds an integer value and a range of valid values.
void setValue(@NotNull final Integer value)
Reflects a game object (object on a map).
static final String PARAMETER_TYPE
The string representation of this parameter type.
int max
The maximal allowed value.
GameObjects are the objects based on Archetypes found on maps.
Abstract base class for PluginParameter implementations for which the string representation of the va...
Interface for MapArchObjects.
boolean setStringValue(@NotNull final String stringValue)
V value
The current value.
IntegerParameter()
Creates a new instance.
Interface for visitors of PluginParameter instances.
int getMin()
Returns the minimal allowed value.
void setMax(final int max)
Sets the maximal allowed value.
void setMin(final int min)
Sets the minimal allowed value.
public< T > T visit(@NotNull final PluginParameterVisitor< G, A, R, T > visitor)