Package net.sf.gridarta.plugin.parameter
Class MapParameter<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.plugin.parameter.AbstractPluginParameter<G,A,R,V>
-
- net.sf.gridarta.plugin.parameter.AbstractStringPluginParameter<G,A,R,MapControl<G,A,R>>
-
- net.sf.gridarta.plugin.parameter.MapParameter<G,A,R>
-
- All Implemented Interfaces:
PluginParameter<G,A,R,MapControl<G,A,R>>
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>>
APluginParameterthat holds aMapControlvalue.
-
-
Field Summary
Fields Modifier and Type Field Description static @NotNull java.lang.StringPARAMETER_TYPEThe string representation of this parameter type.
-
Constructor Summary
Constructors Constructor Description MapParameter(@NotNull MapManager<G,A,R> mapManager, @NotNull PathManager pathManager)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull java.lang.StringgetParameterType()Returns the parameter type name.@NotNull MapControl<G,A,R>getValue()Returns the current value of this parameter.@Nullable MapControl<G,A,R>getValueOrNull()Returns the current value of this parameter.booleanisCurrentMap()Returns whether the current map is selected.voidsetValueToCurrent()Selects the current map.<T> Tvisit(@NotNull PluginParameterVisitor<G,A,R,T> visitor)Calls thevisit()function for this parameter type.-
Methods inherited from class net.sf.gridarta.plugin.parameter.AbstractStringPluginParameter
getStringValue, setStringValue
-
Methods inherited from class net.sf.gridarta.plugin.parameter.AbstractPluginParameter
addPluginParameterListener, changed, getDescription, getName, removePluginParameterListener, setDescription, setName
-
-
-
-
Constructor Detail
-
MapParameter
public MapParameter(@NotNull @NotNull MapManager<G,A,R> mapManager, @NotNull @NotNull PathManager pathManager)Creates a new instance.- Parameters:
mapManager- the map manager for converting map paths to map control instancespathManager- the path manager instance for converting files into path names
-
-
Method Detail
-
getParameterType
@NotNull public @NotNull java.lang.String getParameterType()
Description copied from interface:PluginParameterReturns the parameter type name.- Returns:
- the parameter type name
-
visit
@NotNull public <T> T visit(@NotNull @NotNull PluginParameterVisitor<G,A,R,T> visitor)Description copied from interface:PluginParameterCalls thevisit()function for this parameter type.- Type Parameters:
T- the visitor-specific type of the return value- Parameters:
visitor- the visitor to call- Returns:
- a visitor-specific return value
-
getValue
@NotNull public @NotNull MapControl<G,A,R> getValue() throws InvalidValueException
Description copied from interface:PluginParameterReturns the current value of this parameter.- Returns:
- the value
- Throws:
InvalidValueException- if the the value is invalid
-
getValueOrNull
@Nullable public @Nullable MapControl<G,A,R> getValueOrNull()
Description copied from interface:PluginParameterReturns the current value of this parameter.- Returns:
- the value or
nullif the the value is invalid
-
setValueToCurrent
public void setValueToCurrent()
Selects the current map.
-
isCurrentMap
public boolean isCurrentMap()
Returns whether the current map is selected.- Returns:
- whether the current map is selected
-
-