Click or drag to resize
DigitalRuneGameObject Class
Represents an object of a game.
Inheritance Hierarchy

Namespace: DigitalRune.Game
Assembly: DigitalRune.Game (in DigitalRune.Game.dll) Version: 1.4.0.0 (1.4.0.14427)
Syntax
public class GameObject : INotifyPropertyChanged, IAnimatableObject, 
	INamedObject

The GameObject type exposes the following members.

Constructors
  NameDescription
Public methodGameObject
Initializes a new instance of the GameObject class.
Public methodGameObject(String)
Initializes a new instance of the GameObject class.
Top
Methods
  NameDescription
Public methodStatic memberCreateEventT
Defines a game object event.
Public methodStatic memberCreatePropertyT
Defines a game object property.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodStatic memberGetEventMetadata
Public methodStatic memberGetEventMetadataT(Int32)
Gets the metadata of the event with the given ID.
Public methodStatic memberGetEventMetadataT(String)
Gets metadata for the event with the given name.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodStatic memberGetPropertyMetadata
Public methodStatic memberGetPropertyMetadataT(Int32)
Gets the metadata of the property with the given ID.
Public methodStatic memberGetPropertyMetadataT(String)
Gets the metadata of the property with the given name.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetValueT(Int32)
Gets the value of the property with the given ID.
Public methodGetValueT(String)
Gets the value of the property with the given name.
Public methodGetValueT(GamePropertyMetadataT)
Gets the value of the property with the given metadata.
Public methodLoad
Loads the content of the game object.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodNewFrame
Tells the game object to prepare itself for the next time step.
Protected methodOnLoad
Called when the game object should load its content.
Protected methodOnPropertyChanged(PropertyChangedEventArgs)
Raises the PropertyChanged event.
Protected methodOnPropertyChangedT(GamePropertyT, T, T)
Is called after a game object property was changed.
Protected methodOnTemplateChanged
Raises the TemplateChanged event.
Protected methodOnUnload
Called when the game object should unload its content.
Protected methodOnUpdate
Called when the game object should be updated.
Public methodSetValueT(Int32, T)
Sets the value of the property with the given ID.
Public methodSetValueT(String, T)
Sets the value of the property with the given name.
Public methodSetValueT(GamePropertyMetadataT, T)
Set the value of the property for the given metadata.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUnload
Unloads the content of the game object.
Public methodUpdate
Updates this game object.
Top
Properties
  NameDescription
Public propertyEvents
Gets the game object events.
Public propertyIsLoaded
Gets a value indicating whether the content of this object was loaded.
Public propertyName
Gets or sets the name.
Public propertyProperties
Gets the game object properties.
Public propertyTemplate
Gets or sets the template.
Top
Events
  NameDescription
Public eventPropertyChanged
Occurs when a property value has changed.
Public eventTemplateChanged
Occurs when the Template changed.
Top
Explicit Interface Implementations
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 IAnimatablePropertyT by calling AsAnimatable.

Interface INotifyPropertyChanged: The game object implements INotifyPropertyChanged. For GamePropertyTs this is automatically handled by the GamePropertyT itself. If derived classes need to raise the event for "normal" properties, they have to call OnPropertyChanged(PropertyChangedEventArgs).

See Also