Class VariableRegistry
java.lang.Object
io.lumine.mythic.core.skills.variables.VariableRegistry
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
ConstructorDescriptionCreate a new instance.VariableRegistry
(Map<String, Variable> value) Create a new instance and use the given map (which will be modified). -
Method Summary
Modifier and TypeMethodDescriptionasMap()
Get the registry as an immutable mapvoid
clean()
clone()
float
Get the variable with the given key as an integer, if possibleint
Get the variable with the given key as an integer, if possiblegetOrDefault
(String key, Variable def) boolean
void
Put the given key and variable into the registry.void
Put all the entries from the given map into the registryvoid
Put the given key and value into the registry as aFloatVariable
.void
Put the given key and value into the registry as aIntVariable
.void
putLocation
(String key, AbstractLocation value) Put the given key and value into the registry as aLocationVariable
.void
Put the given key and value into the registry as an object.void
Put the given key and value into the registry as aStringVariable
.void
putVector
(String key, AbstractVector value) Put the given key and value into the registry as aVectorVariable
.void
Remove the given entry from the registry, if it existsvoid
unload()
-
Constructor Details
-
VariableRegistry
public VariableRegistry()Create a new instance. -
VariableRegistry
Create a new instance and use the given map (which will be modified).- Parameters:
value
- the value
-
-
Method Details
-
put
Put the given key and variable into the registry.- Parameters:
key
- they keyvalue
- the value
-
putAll
Put all the entries from the given map into the registry- Parameters:
value
- the map of variables
-
remove
Remove the given entry from the registry, if it exists- Parameters:
key
-
-
has
-
get
-
getOrDefault
-
putInt
Put the given key and value into the registry as aIntVariable
.- Parameters:
key
- they keyvalue
- the value
-
getInt
Get the variable with the given key as an integer, if possible- Parameters:
key
-- Returns:
-
putString
Put the given key and value into the registry as aStringVariable
.- Parameters:
key
- they keyvalue
- the value
-
getString
-
putFloat
Put the given key and value into the registry as aFloatVariable
.- Parameters:
key
- they keyvalue
- the value
-
getFloat
Get the variable with the given key as an integer, if possible- Parameters:
key
-- Returns:
-
putLocation
Put the given key and value into the registry as aLocationVariable
.- Parameters:
key
- they keyvalue
- the value
-
putVector
Put the given key and value into the registry as aVectorVariable
.- Parameters:
key
- they keyvalue
- the value
-
putObject
Put the given key and value into the registry as an object. Cannot be saved.- Parameters:
key
- they keyvalue
- the value
-
asMap
Get the registry as an immutable map- Returns:
-
clean
public void clean() -
unload
public void unload() -
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-