Table of Contents

Class EngineElement

Namespace
OmegaEngine
Assembly
OmegaEngine.dll

A common base class for all objects that need an Engine instance.

public abstract class EngineElement : IDisposable
Inheritance
EngineElement
Implements
Derived
Inherited Members
Extension Methods

Properties

Engine

The Engine instance used by this object. Must be set before using the object. May not be changed once it has been set!

[Browsable(false)]
public Engine Engine { get; set; }

Property Value

Engine

Exceptions

InvalidOperationException

Trying to read the engine before it has been set.

IsDisposed

Indicates whether this object has been disposed and can therefore no longer be used.

[Browsable(false)]
public bool IsDisposed { get; }

Property Value

bool

IsEngineSet

true if the Engine has been set.

[Browsable(false)]
public bool IsEngineSet { get; }

Property Value

bool

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

~EngineElement()

protected ~EngineElement()

OnDispose()

Hook that is called when the object needs to dispose its internal resources.

protected virtual void OnDispose()

OnEngineSet()

Hook that is called when Engine is set for the first time.

protected virtual void OnEngineSet()

RegisterChild(EngineElement?, bool)

Registers a child EngineElement for automatic Engine setting and Dispose() calling.

protected void RegisterChild(EngineElement? element, bool autoDispose = true)

Parameters

element EngineElement

The EngineElement to register. Silently ignores null.

autoDispose bool

Controls whether the element is automatically disposed when Dispose() is called.

Remarks

This method is thread-safe.

UnregisterChild(EngineElement?)

Unregisters a child EngineElement (opposite of RegisterChild(EngineElement?, bool)).

protected void UnregisterChild(EngineElement? element)

Parameters

element EngineElement

The EngineElement to unregister. Silently ignores null.