 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.plugin.parameter;
25 import org.jetbrains.annotations.NotNull;
48 private double max = 1.0;
60 return visitor.visit(
this);
65 final double doubleValue;
67 doubleValue = Double.parseDouble(stringValue);
68 }
catch (
final NumberFormatException ignored) {
71 if (doubleValue <
min) {
74 if (doubleValue >
max) {
85 super.setValue(Math.max(Math.min(
value,
max),
min));
113 final double newMax = Math.max(
min,
max);
114 if (this.max == newMax) {
137 final double newMin = Math.min(
min,
max);
138 if (this.min == newMin) {
void setMin(final double min)
Sets the minimal allowed value.
Base package of all Gridarta classes.
double getMax()
Returns the maximal allowed value.
Reflects a game object (object on a map).
void setValue(@NotNull final Double value)
GameObjects are the objects based on Archetypes found on maps.
double min
The minimal allowed value.
Abstract base class for PluginParameter implementations for which the string representation of the va...
Interface for MapArchObjects.
String getParameterType()
double max
The maximal allowed value.
double getMin()
Returns the minimal allowed value.
static final String PARAMETER_TYPE
The string representation of this parameter type.
DoubleParameter()
Creates a new instance.
A PluginParameter that holds a double value.
public< T > T visit(@NotNull final PluginParameterVisitor< G, A, R, T > visitor)
V value
The current value.
Interface for visitors of PluginParameter instances.
void setMax(final double max)
Sets the maximal allowed value.
boolean setStringValue(@NotNull final String stringValue)