Interface IStateManager<TStateKey, TStateData, TStateDataContext>
A state manager
Namespace: Unity.AI.Planner
Syntax
public interface IStateManager<TStateKey, TStateData, TStateDataContext> : IEqualityComparer<TStateData> where TStateKey : struct, IEquatable<TStateKey> where TStateData : struct where TStateDataContext : struct, IStateDataContext<TStateKey, TStateData>
Type Parameters
Name | Description |
---|---|
TStateKey | StateKey type |
TStateData | StateData type |
TStateDataContext | StateDataContext type |
Methods
CopyState(TStateKey)
Copy an existing state
Declaration
TStateKey CopyState(TStateKey stateKey)
Parameters
Type | Name | Description |
---|---|---|
TStateKey | stateKey | Key to access the state to copy |
Returns
Type | Description |
---|---|
TStateKey | Copied state |
CopyStateData(TStateData)
Copy an existing state
Declaration
TStateData CopyStateData(TStateData stateData)
Parameters
Type | Name | Description |
---|---|---|
TStateData | stateData | Existing state to copy |
Returns
Type | Description |
---|---|
TStateData | Copied state |
CreateStateData()
Create a new state
Declaration
TStateData CreateStateData()
Returns
Type | Description |
---|---|
TStateData | Newly created state |
DestroyState(TStateKey)
Destroy a state
Declaration
void DestroyState(TStateKey stateKey)
Parameters
Type | Name | Description |
---|---|---|
TStateKey | stateKey | Key to access the state that should be destroyed |
GetStateData(TStateKey, Boolean)
Get the state data for a given key
Declaration
TStateData GetStateData(TStateKey stateKey, bool readWrite)
Parameters
Type | Name | Description |
---|---|---|
TStateKey | stateKey | Key to access the state |
System.Boolean | readWrite | Whether the state needs write-back capabilities |
Returns
Type | Description |
---|---|
TStateData | State data for the given key |
GetStateDataContext()
Get a wrapper context to access states in a detached manner (e.g. within jobs); See IStateDataContext<TStateKey, TStateData>
Declaration
TStateDataContext GetStateDataContext()
Returns
Type | Description |
---|---|
TStateDataContext |
GetStateDataKey(TStateData)
Get the key used to access the state data
Declaration
TStateKey GetStateDataKey(TStateData stateData)
Parameters
Type | Name | Description |
---|---|---|
TStateData | stateData | State data |
Returns
Type | Description |
---|---|
TStateKey | Key that can be used to access the state |