Show / Hide Table of Contents

Class UnrealGameState

A class representing game state for Unreal Engine 4 or 5.

Inheritance
object
StateBase<ObjectInfo, IGameObject>
GameStateBase
GenericGameState
UnrealGameState
Implements
IDisposable
IGenericGameState
IGameState
IState<ObjectInfo, IGameObject>
IReadOnlyCollection<IGameObject>
IEnumerable<IGameObject>
IEnumerable
IEventAggregator<IGameEventArgs>
IEventPublisher<IGameEventArgs>
IHasUpdateTime
IQueryResultConsumer<IGameObject>
IEventProcessor
Inherited Members
GenericGameState.GameStateChangedEventName
GenericGameState.ClassManager
GenericGameState.Repository
GenericGameState.MergeResult(in QueryResult)
GenericGameState.GetAll<T>(string, TimeSpan, CancellationToken)
GenericGameState.GetAll<T>(TimeSpan, CancellationToken)
GenericGameState.Get<T>(ObjectInfo, TimeSpan, CancellationToken)
GenericGameState.Get<T>(string, TimeSpan, CancellationToken)
GenericGameState.Get<T>(TimeSpan, CancellationToken)
GenericGameState.Existing<T>(string)
GenericGameState.Existing(ObjectInfo)
GenericGameState.ClearAll<T>(params string[])
GenericGameState.Clear<T>(ObjectInfo?)
GenericGameState.ProcessEvents()
GenericGameState.GetObjects(ObjectInfo, CancellationToken)
GenericGameState.Match(IGameObject, string)
GenericGameState.HandleGameStateChangedEvent(object, IGameEventArgs)
GenericGameState.CheckQueryResultChangesGameClass(in QueryResult)
GameStateBase.EventReceived
GameStateBase.RecentEvents
GameStateBase.GameCache
GameStateBase.EventAggregator
GameStateBase.GetAll<T>(ObjectInfo, TimeSpan, CancellationToken)
GameStateBase.Existing<T>(ObjectInfo?)
GameStateBase.ExistingAll<T>(string)
GameStateBase.Clear(ObjectInfo?)
GameStateBase.ClearEvents()
GameStateBase.GetObject(ObjectInfo, CancellationToken)
GameStateBase.Set(in ObjectInfo, IGameObject)
GameStateBase.PublishEvent(object, IGameEventArgs)
StateBase<ObjectInfo, IGameObject>.Logger
StateBase<ObjectInfo, IGameObject>.UpdateTime
StateBase<ObjectInfo, IGameObject>.Count
StateBase<ObjectInfo, IGameObject>.IsUpdateInProgress
StateBase<ObjectInfo, IGameObject>.Cache
StateBase<ObjectInfo, IGameObject>.Semaphore
StateBase<ObjectInfo, IGameObject>.UpdateProcessor
StateBase<ObjectInfo, IGameObject>.Get(ObjectInfo, TimeSpan, CancellationToken)
StateBase<ObjectInfo, IGameObject>.Existing(ObjectInfo)
StateBase<ObjectInfo, IGameObject>.Clear(ObjectInfo)
StateBase<ObjectInfo, IGameObject>.WaitForUpdateFinished()
StateBase<ObjectInfo, IGameObject>.Dispose()
StateBase<ObjectInfo, IGameObject>.GetEnumerator()
StateBase<ObjectInfo, IGameObject>.GetObject(ObjectInfo, CancellationToken)
StateBase<ObjectInfo, IGameObject>.Set(in ObjectInfo, IGameObject)
StateBase<ObjectInfo, IGameObject>.AgeObject(ObjectInfo)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Microsoft.XboxStudios.GameStateTracker.Unreal
Assembly: GameStateTracker.Unreal.dll
Syntax
public class UnrealGameState : GenericGameState, IDisposable, IGenericGameState, IGameState, IState<ObjectInfo, IGameObject>, IReadOnlyCollection<IGameObject>, IEnumerable<IGameObject>, IEnumerable, IEventAggregator<IGameEventArgs>, IEventPublisher<IGameEventArgs>, IHasUpdateTime, IQueryResultConsumer<IGameObject>, IEventProcessor
Remarks

Initializes a new instance of the UnrealGameState class.

Constructors

View Source

UnrealGameState(IGenericGameObjectRepository, IClassManager?, ILogger<UnrealGameState>?, IGameObjectCache?)

A class representing game state for Unreal Engine 4 or 5.

Declaration
public UnrealGameState(IGenericGameObjectRepository repository, IClassManager? classManager = null, ILogger<UnrealGameState>? logger = null, IGameObjectCache? cache = null)
Parameters
Type Name Description
IGenericGameObjectRepository repository

The generic object repository.

IClassManager classManager

The class manager.

ILogger<UnrealGameState> logger

The logger to use.

IGameObjectCache cache

The cache to use to store game objects.

Remarks

Initializes a new instance of the UnrealGameState class.

Methods

View Source

AgeObject(ObjectInfo)

Gets the age of an object in the cache.

Declaration
protected override TimeSpan? AgeObject(ObjectInfo info)
Parameters
Type Name Description
ObjectInfo info

The object info.

Returns
Type Description
TimeSpan?

The time since the object was last refreshed.

Overrides
StateBase<ObjectInfo, IGameObject>.AgeObject(ObjectInfo)
Remarks

When we query an object and check if it exists and how old it is in the cache, see if there's any matching object in the cache, even if the given query is slightly different.

View Source

Match(IGameObject, in ObjectInfo)

Determines if the game object matches the given query.

Declaration
protected override bool Match(IGameObject input, in ObjectInfo query)
Parameters
Type Name Description
IGameObject input

The game object.

ObjectInfo query

The query.

Returns
Type Description
bool

True if the game object matches the given query.

Overrides
GameStateBase.Match(IGameObject, in ObjectInfo)

Implements

IDisposable
IGenericGameState
IGameState
IState<TKey, TValue>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable
IEventAggregator<T>
IEventPublisher<T>
IHasUpdateTime
IQueryResultConsumer<T>
IEventProcessor

Extension Methods

IQueryResultConsumerExtensions.MergeResults<T>(IQueryResultConsumer<T>, IEnumerable<QueryResult>?)
IGameStateExtensions.GetLocalPlayerPawn<T>(IGameState, int, TimeSpan)
IGameStateExtensions.GetLocalPlayerState<T>(IGameState, int, TimeSpan)
IGameStateExtensions.GetLocalPlayer<T>(IGameState, int, TimeSpan)
IGameStateExtensions.GetPlayerLocation<T>(IGameState, int, TimeSpan)
IGameStateExtensions.LocalPlayer(IGameState, int)
IGameStateExtensions.LocalPlayerState(IGameState, int)
IGameStateExtensions.OrderByNearest<T>(IGameState, int, IEnumerable<T>)
IGameStateExtensions.PlayerDistanceTo(IGameState, int, IActor)
IGameStateExtensions.PlayerDistanceTo(IGameState, int, Vector3?)
IGameStateExtensions.PlayerLocation(IGameState, int)
IEnumerableExtensions.WithoutLast<T>(IEnumerable<T>)
  • View Source
In this article
Back to top Generated by DocFX