public class MapParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends AbstractStringPluginParameter<G,A,R,MapControl<G,A,R>>
PluginParameter
that holds a MapControl
value.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PARAMETER_TYPE
The string representation of this parameter type.
|
Constructor and Description |
---|
MapParameter(MapManager<G,A,R> mapManager,
PathManager pathManager)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getParameterType()
Returns the parameter type name.
|
MapControl<G,A,R> |
getValue()
Returns the current value of this parameter.
|
MapControl<G,A,R> |
getValueOrNull()
Returns the current value of this parameter.
|
boolean |
isCurrentMap()
Returns whether the current map is selected.
|
void |
setValueToCurrent()
Selects the current map.
|
<T> T |
visit(PluginParameterVisitor<G,A,R,T> visitor)
Calls the
visit() function for this parameter type. |
getStringValue, setStringValue
addPluginParameterListener, changed, getDescription, getName, removePluginParameterListener, setDescription, setName
@NotNull public static final java.lang.String PARAMETER_TYPE
public MapParameter(@NotNull MapManager<G,A,R> mapManager, @NotNull PathManager pathManager)
mapManager
- the map manager for converting map paths to map control
instancespathManager
- the path manager instance for converting files into
path names@NotNull public java.lang.String getParameterType()
@NotNull public <T> T visit(@NotNull PluginParameterVisitor<G,A,R,T> visitor)
visit()
function for this parameter type.T
- the visitor-specific type of the return valuevisitor
- the visitor to call@NotNull public MapControl<G,A,R> getValue() throws InvalidValueException
InvalidValueException
- if the the value is invalid@Nullable public MapControl<G,A,R> getValueOrNull()
null
if the the value is invalidpublic void setValueToCurrent()
public boolean isCurrentMap()