Class UnrealObjectRepository
A generic game object repository implementation using Unreal Engine console commands.
Inheritance
Implements
Inherited Members
Namespace: Microsoft.XboxStudios.GameStateTracker.Unreal
Assembly: GameStateTracker.Unreal.dll
Syntax
public class UnrealObjectRepository : GenericGameObjectRepositoryBase, IGenericGameObjectRepository, IGameObjectRepository, IEventPublisher<IGameEventArgs>, IGameObjectFormatterProvider
Remarks
Initializes a new instance of the UnrealObjectRepository class.
Constructors
View SourceUnrealObjectRepository(IUnrealConsoleCommandClient)
A generic game object repository implementation using Unreal Engine console commands.
Declaration
public UnrealObjectRepository(IUnrealConsoleCommandClient client)
Parameters
Type | Name | Description |
---|---|---|
IUnrealConsoleCommandClient | client | The game client. |
Remarks
Initializes a new instance of the UnrealObjectRepository class.
Properties
View SourceClient
Gets the game client.
Declaration
protected IUnrealConsoleCommandClient Client { get; }
Property Value
Type | Description |
---|---|
IUnrealConsoleCommandClient |
Formatter
Gets or sets an object for formatting game objects in a user-friendly manner.
Declaration
public IGameObjectFormatter Formatter { get; protected set; }
Property Value
Type | Description |
---|---|
IGameObjectFormatter |
IncludeBlueprintClasses
Gets or sets a value indicating whether or not to display non-intrinsic (C++ only) classes.
Declaration
public bool IncludeBlueprintClasses { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
View SourceGetClassTree(CancellationToken)
Gets the class tree.
Declaration
public override Task<ILookup<string?, string>> GetClassTree(CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | token | The cancellation token. |
Returns
Type | Description |
---|---|
Task<ILookup<string, string>> | A lookup table from parent class name to subclass names. |
Overrides
View SourceGetProperties(ObjectInfo, IReadOnlyCollection<string>, CancellationToken)
Retrieves property values for all objects matching the given query.
Declaration
public override Task<IEnumerable<QueryResult>> GetProperties(ObjectInfo query, IReadOnlyCollection<string> properties, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
ObjectInfo | query | The objects to look for. |
IReadOnlyCollection<string> | properties | The properties to retrieve. |
CancellationToken | token | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IEnumerable<QueryResult>> | An enumeration of each matching object and property value. |
Overrides
View SourceGetProperty(ObjectInfo, string, CancellationToken)
Gets a property value using console commands to query game objects.
Declaration
protected Task<IEnumerable<QueryResult>> GetProperty(ObjectInfo info, string propertyName, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
ObjectInfo | info | The objects to query. |
string | propertyName | The property name. |
CancellationToken | token | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IEnumerable<QueryResult>> | An enumeration of each matching object and property value. |
GetQueryParameters(in ObjectInfo)
Gets the parameters to query the given object.
Declaration
protected static string GetQueryParameters(in ObjectInfo info)
Parameters
Type | Name | Description |
---|---|---|
ObjectInfo | info | The object info. |
Returns
Type | Description |
---|---|
string | The query parameters. |
ListGameObjects(ObjectInfo, CancellationToken)
Retrieves the description of all objects matching the given query.
Declaration
public override Task<IEnumerable<ObjectInfo>> ListGameObjects(ObjectInfo query, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
ObjectInfo | query | The objects to look for. |
CancellationToken | token | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IEnumerable<ObjectInfo>> | An enumeration of object descriptions. |
Overrides
View SourceListPropertiesByClass(string, string, CancellationToken)
Lists all matching properties of the given class name.
Declaration
public override Task<IEnumerable<string>> ListPropertiesByClass(string className, string propertyFilter = "*", CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
string | className | The class name. |
string | propertyFilter | An optional pattern to filter property names, using ? and * as wildcard characters. |
CancellationToken | token | The cancellation token. |
Returns
Type | Description |
---|---|
Task<IEnumerable<string>> | An enumeration of property names. |
Overrides
View SourcePopulateClassProperties(IClassManager, string, string?)
Populates the class manager for the specified class, using the ListPropertiesByClass method.
Declaration
public override Task PopulateClassProperties(IClassManager classManager, string className, string? parentClass = null)
Parameters
Type | Name | Description |
---|---|---|
IClassManager | classManager | The class manager. |
string | className | The class name. |
string | parentClass | The parent class name. |
Returns
Type | Description |
---|---|
Task | A task representing the work to populate the class manager. |
Overrides
View SourcePublish(object, IGameEventArgs)
Publishes an event.
Declaration
protected void Publish(object sender, IGameEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
object | sender | The event source. |
IGameEventArgs | e | The event. |
Events
View SourceEventReceived
Occurs when a game event is published.
Declaration
public event EventHandler<IGameEventArgs>? EventReceived
Event Type
Type | Description |
---|---|
EventHandler<IGameEventArgs> |