Represents an object of a game.

Namespace: DigitalRune.Game
Assembly: DigitalRune.Game (in DigitalRune.Game.dll) Version: 1.0.0.0 (1.0.1.9459)

Syntax

C#
public class GameObject : INotifyPropertyChanged, IAnimatableObject, 
	INamedObject
Visual Basic
Public Class GameObject _
	Implements INotifyPropertyChanged, IAnimatableObject, INamedObject
Visual C++
public ref class GameObject : INotifyPropertyChanged, 
	IAnimatableObject, INamedObject

Remarks

GameObjects represent individual items of game logic that are updated once per frame. Game objects are also called game components, game entities, controls, actors, etc.

Important note: Each game object must be given a name that is unique within the IGameObjectService or the GameObjectCollection in which it will be used.

Notes to Inheritors: Derived classes should override OnUpdate(TimeSpan). OnUpdate(TimeSpan) is the place for the logic of the game object.

Interface IAnimatableObject: The game object implements the interface IAnimatableObject. All game object properties can be animated by the DigitalRune Animation system! Any game property can be cast into an IAnimatableProperty<(Of <(<'T>)>)> by calling AsAnimatable()()()().

Interface INotifyPropertyChanged: The game object implements INotifyPropertyChanged. For GameProperty<(Of <(<'T>)>)>s this is automatically handled by the GameProperty<(Of <(<'T>)>)> itself. If derived classes need to raise the event for "normal" properties, they have to call OnPropertyChanged(PropertyChangedEventArgs).

Inheritance Hierarchy

System..::..Object
  DigitalRune.Game..::..GameObject
    DigitalRune.Game.UI.Controls..::..UIControl

See Also