Interface IStateDataContext<TStateKey, TStateData>
An interface that marks an implementation of a wrapper context for managing states within a domain. Not all domain language implementations may require a state data context, but for those that do (e.g. Entities-based) it provides a way to work with states in a detached manager from the StateManager (e.g. within jobs) and queue any changes up for playback later.
Namespace: Unity.AI.Planner
Syntax
public interface IStateDataContext<TStateKey, TStateData> : IEqualityComparer<TStateData> where TStateKey : struct, IEquatable<TStateKey> where TStateData : struct
Type Parameters
Name | Description |
---|---|
TStateKey | StateKey type |
TStateData | StateData type |
Methods
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 |
GetStateData(TStateKey)
Get the state data for a given key
Declaration
TStateData GetStateData(TStateKey stateKey)
Parameters
Type | Name | Description |
---|---|---|
TStateKey | stateKey | Key to access the state |
Returns
Type | Description |
---|---|
TStateData | State data for the given key |