Class StateConfig
java.lang.Object
com.blackrook.engine.state.StateConfig
A state configuration object.
Holds parameters for a state transition and used on state entry.
- Author:
- Matthew Tropiano
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StateConfigcreateConfig(Map.Entry<String, Object>... entries) Creates a new state config using entries.Creates a single mapping entry.<T> TgetParameter(Class<T> type, String name) Gets a config parameter, casting it to the desired type.voidsetParameter(String name, Object value) Sets a config parameter.
-
Constructor Details
-
StateConfig
protected StateConfig()Protected constructor for config.
-
-
Method Details
-
setParameter
-
getParameter
Gets a config parameter, casting it to the desired type.- Type Parameters:
T- the type casted to.- Parameters:
type- the class type to cast to.name- the parameter name.- Returns:
- the corresponding value, or null if not found.
- Throws:
ClassCastException- if the value could not be casted to the desired type.
-
entry
-
createConfig
Creates a new state config using entries.- Parameters:
entries- the parameter mapping entries.- Returns:
- a new state config.
- See Also:
-