GameObject Class |
Namespace: DigitalRune.Game
The GameObject type exposes the following members.
Name | Description | |
---|---|---|
GameObject |
Initializes a new instance of the GameObject class.
| |
GameObject(String) |
Initializes a new instance of the GameObject class.
|
Name | Description | |
---|---|---|
CreateEventT |
Defines a game object event.
| |
CreatePropertyT |
Defines a game object property.
| |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetEventMetadata |
Gets the metadata of all game object events that were created with
CreateEventT(String, String, String, T).
| |
GetEventMetadataT(Int32) |
Gets the metadata of the event with the given ID.
| |
GetEventMetadataT(String) |
Gets metadata for the event with the given name.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetPropertyMetadata |
Gets the metadata of all game object properties that were created with
CreatePropertyT(String, String, String, T).
| |
GetPropertyMetadataT(Int32) |
Gets the metadata of the property with the given ID.
| |
GetPropertyMetadataT(String) |
Gets the metadata of the property with the given name.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetValueT(Int32) |
Gets the value of the property with the given ID.
| |
GetValueT(String) |
Gets the value of the property with the given name.
| |
GetValueT(GamePropertyMetadataT) |
Gets the value of the property with the given metadata.
| |
Load |
Loads the content of the game object.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
NewFrame |
Tells the game object to prepare itself for the next time step.
| |
OnLoad |
Called when the game object should load its content.
| |
OnPropertyChanged(PropertyChangedEventArgs) |
Raises the PropertyChanged event.
| |
OnPropertyChangedT(GamePropertyT, T, T) |
Is called after a game object property was changed.
| |
OnTemplateChanged |
Raises the TemplateChanged event.
| |
OnUnload |
Called when the game object should unload its content.
| |
OnUpdate |
Called when the game object should be updated.
| |
SetValueT(Int32, T) |
Sets the value of the property with the given ID.
| |
SetValueT(String, T) |
Sets the value of the property with the given name.
| |
SetValueT(GamePropertyMetadataT, T) |
Set the value of the property for the given metadata.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
Unload |
Unloads the content of the game object.
| |
Update |
Updates this game object.
|
Name | Description | |
---|---|---|
Events |
Gets the game object events.
| |
IsLoaded |
Gets a value indicating whether the content of this object was loaded.
| |
Name |
Gets or sets the name.
| |
Properties |
Gets the game object properties.
| |
Template |
Gets or sets the template.
|
Name | Description | |
---|---|---|
PropertyChanged |
Occurs when a property value has changed.
| |
TemplateChanged |
Occurs when the Template changed.
|
Name | Description | |
---|---|---|
INotifyPropertyChangedPropertyChanged |
Occurs when a property value has changed.
| |
IAnimatableObjectGetAnimatablePropertyT |
Gets the property with given name and type which can be animated.
| |
IAnimatableObjectGetAnimatedProperties |
Gets either the properties which are currently animated, or all properties which can be
animated. (See 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).