Show / Hide Table of Contents

Class GameObject

A sealed class representing a generic game object.

Inheritance
object
GameObject
Implements
IGameObject
INotifyPropertyChanged
Inherited Members
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
Namespace: Microsoft.XboxStudios.GameStateTracker
Assembly: GameStateTracker.Core.dll
Syntax
public sealed class GameObject : IGameObject, INotifyPropertyChanged

Constructors

View Source

GameObject(ObjectInfo)

Initializes a new instance of the GameObject class.

Declaration
public GameObject(ObjectInfo info)
Parameters
Type Name Description
ObjectInfo info

The object info.

View Source

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 Source

ClassKey

The property name of the object's class.

Declaration
public const string ClassKey = "class"
Field Value
Type Description
string
View Source

NameKey

The property name of the object's name.

Declaration
public const string NameKey = "name"
Field Value
Type Description
string

Properties

View Source

GameState

Gets or sets the game state associated with the game object.

Declaration
public IGameState? GameState { get; set; }
Property Value
Type Description
IGameState
View Source

Info

Gets all of the necessary information to identify the object.

Declaration
public ObjectInfo Info { get; }
Property Value
Type Description
ObjectInfo
View Source

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.

View Source

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 Source

Equals(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
object.Equals(object)
View Source

GetHashCode()

Serves as the default hash function.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current object.

Overrides
object.GetHashCode()
View Source

ToString()

Returns the object's full name.

Declaration
public override string ToString()
Returns
Type Description
string

A string representation of the object.

Overrides
object.ToString()

Events

View Source

PropertyChanged

The property changed event for INotifyPropertyChanged support.

Declaration
public event PropertyChangedEventHandler? PropertyChanged
Event Type
Type Description
PropertyChangedEventHandler

Implements

IGameObject
INotifyPropertyChanged

Extension Methods

IGameObjectExtensions.ClassName(IGameObject)
IGameObjectExtensions.InfoEquals(IGameObject, IGameObject?)
IGameObjectExtensions.InfoEquals(IGameObject, in ObjectInfo)
IGameObjectExtensions.ObjectName(IGameObject)
IGameObjectExtensions.Matches(IGameObject, IClassManager, in ObjectInfo)
  • View Source
In this article
Back to top Generated by DocFX