Table of Contents

Class GameObject

Namespace
Termule.Engine.Core
Assembly
Termule.Engine.dll

A component that groups together child components.

public sealed class GameObject : Component, IEnumerable<Component>, IEnumerable
Inheritance
GameObject
Implements
Inherited Members

Constructors

GameObject()

Initializes a new instance of the GameObject class.

public GameObject()

GameObject(params Component[])

Initializes a new instance of the GameObject class with the provided components.

public GameObject(params Component[] components)

Parameters

components Component[]

The components that the GameObject should contain.

Properties

Bus

Gets the local message bus.

public LocalMessageBus Bus { get; }

Property Value

LocalMessageBus

Methods

Activate()

Called when this element is added to a Game.

protected override void Activate()

Add(params Component[])

Adds the provided components to this game object.

public void Add(params Component[] components)

Parameters

components Component[]

The components to add.

Deactivate()

Called when this element is removed from its Game.

protected override void Deactivate()

GetAll<TComponent>()

Gets all components of type TComponent.

public IEnumerable<TComponent> GetAll<TComponent>()

Returns

IEnumerable<TComponent>

The collection of all matching components.

Type Parameters

TComponent

The type of component to look for.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<Component> GetEnumerator()

Returns

IEnumerator<Component>

An enumerator that can be used to iterate through the collection.

Get<TComponent>()

Gets a component of type TComponent.

public TComponent Get<TComponent>()

Returns

TComponent

The component if one is found or null.

Type Parameters

TComponent

The type of component to look for.

Remove(Component)

Removes the provided component from this game object.

public void Remove(Component component)

Parameters

component Component

The component to remove.

Exceptions

InvalidOperationException

Thrown if the provided component is not part of this game object.

Tick()

Called once per tick.

protected override void Tick()