Class GameObject
A sealed class representing a generic game object.
Inherited Members
Namespace: Microsoft.XboxStudios.GameStateTracker
Assembly: GameStateTracker.Core.dll
Syntax
public sealed class GameObject : IGameObject, INotifyPropertyChanged
Constructors
View SourceGameObject(ObjectInfo)
Initializes a new instance of the GameObject class.
Declaration
public GameObject(ObjectInfo info)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjectInfo | info | The object info. |
GameObject(string, string, StringComparison)
Initializes a new instance of the GameObject class.
Declaration
public GameObject(string className, string name, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase)
Parameters
| Type | Name | Description |
|---|---|---|
| string | className | The object's class name. |
| string | name | The object's name. |
| StringComparison | comparisonType | The comparison type to use for the object's properties. |
Fields
View SourceClassKey
The property name of the object's class.
Declaration
public const string ClassKey = "class"
Field Value
| Type | Description |
|---|---|
| string |
NameKey
The property name of the object's name.
Declaration
public const string NameKey = "name"
Field Value
| Type | Description |
|---|---|
| string |
Properties
View SourceGameState
Gets or sets the game state associated with the game object.
Declaration
public IGameState? GameState { get; set; }
Property Value
| Type | Description |
|---|---|
| IGameState |
Info
Gets all of the necessary information to identify the object.
Declaration
public ObjectInfo Info { get; }
Property Value
| Type | Description |
|---|---|
| ObjectInfo |
this[string]
Gets or sets the value of a property with the given name.
Declaration
public object? this[string key] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The property name. |
Property Value
| Type | Description |
|---|---|
| object | The property value, or null if no property was found. |
Properties
Gets a collection of property names for the game object.
Declaration
public IReadOnlyCollection<string> Properties { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyCollection<string> |
Methods
View SourceEquals(object?)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current object. |
Returns
| Type | Description |
|---|---|
| bool | true if the specified object is equal to the current object; otherwise, false. |
Overrides
View SourceGetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
View SourceToString()
Returns the object's full name.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string representation of the object. |
Overrides
Events
View SourcePropertyChanged
The property changed event for INotifyPropertyChanged support.
Declaration
public event PropertyChangedEventHandler? PropertyChanged
Event Type
| Type | Description |
|---|---|
| PropertyChangedEventHandler |