Class VariableRegistry
java.lang.Object
io.lumine.mythic.core.skills.variables.VariableRegistry
- All Implemented Interfaces:
Cloneable
-
Constructor Summary
ConstructorsConstructorDescriptionCreate 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 mapvoidclean()clone()floatGet the variable with the given key as an integer, if possibleintGet the variable with the given key as an integer, if possiblegetOrDefault(String key, Variable def) booleanvoidPut the given key and variable into the registry.voidPut all the entries from the given map into the registryvoidPut the given key and value into the registry as aFloatVariable.voidPut the given key and value into the registry as aIntVariable.voidputLocation(String key, AbstractLocation value) Put the given key and value into the registry as aLocationVariable.voidPut the given key and value into the registry as an object.voidPut the given key and value into the registry as aStringVariable.voidputVector(String key, AbstractVector value) Put the given key and value into the registry as aVectorVariable.voidRemove the given entry from the registry, if it existsvoidunload()
-
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:
clonein classObject- Throws:
CloneNotSupportedException
-