Class GenericGameObject
A base class used to encapsulate a generic game object.
Inherited Members
Namespace: Microsoft.XboxStudios.GameStateTracker.Generic
Assembly: GameStateTracker.Generic.Abstractions.dll
Syntax
public class GenericGameObject : IGameObject, INotifyPropertyChanged
Constructors
View SourceGenericGameObject(IGameObject)
Initializes a new instance of the GenericGameObject class.
Declaration
public GenericGameObject(IGameObject gameObject)
Parameters
| Type | Name | Description |
|---|---|---|
| IGameObject | gameObject | The game object to encapsulate. |
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 the object's info.
Declaration
public ObjectInfo Info { get; }
Property Value
| Type | Description |
|---|---|
| ObjectInfo |
this[string]
Gets 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. |
Name
Gets the object's name.
Declaration
public virtual string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
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 SourceOnGameObjectPropertyChanged(object?, PropertyChangedEventArgs)
Called when a property changes on the underlying game object.
Declaration
protected virtual void OnGameObjectPropertyChanged(object? sender, PropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| object | sender | The sender. |
| PropertyChangedEventArgs | e | The property changed event args. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | A string that represents the current object. |
Overrides
Events
View SourcePropertyChanged
Occurs when one of the game object's properties changes.
Declaration
public event PropertyChangedEventHandler? PropertyChanged
Event Type
| Type | Description |
|---|---|
| PropertyChangedEventHandler |