OmegaEngine API  1.0.3
Public Member Functions | Public Attributes | Protected Member Functions | Properties | List of all members
OmegaEngine.EngineElement Class Reference

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

Inheritance diagram for OmegaEngine.EngineElement:
OmegaEngine.Audio.Song OmegaEngine.Audio.Sound OmegaEngine.Engine OmegaEngine.EngineElementCollection< T > OmegaEngine.Graphics.Renderables.Renderable OmegaEngine.Graphics.Scene OmegaEngine.Graphics.Shaders.Shader OmegaEngine.Graphics.View

Public Member Functions

void Dispose ()
 

Public Attributes

bool IsEngineSet => _engine != null
 true if the Engine has been set. More...
 

Protected Member Functions

void RegisterChild (EngineElement element, bool autoDispose=true)
 Registers a child EngineElement for automatic Engine setting and Dispose calling. More...
 
void UnregisterChild (EngineElement element)
 Unregisters a child EngineElement (opposite of RegisterChild). More...
 
virtual void OnEngineSet ()
 Hook that is calld when Engine is set for the first time. More...
 
virtual void OnDispose ()
 Hook that is called when the object needs to dispose its internal resources. More...
 

Properties

Engine Engine [get, set]
 The Engine instance used by this object. Must be set before using the object. May not be changed once it has been set! More...
 
bool IsDisposed [get]
 Indicates whether this object has been disposed and can therefore no longer be used. More...
 

Detailed Description

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

Member Function Documentation

◆ OnDispose()

virtual void OmegaEngine.EngineElement.OnDispose ( )
inlineprotectedvirtual

◆ OnEngineSet()

virtual void OmegaEngine.EngineElement.OnEngineSet ( )
inlineprotectedvirtual

◆ RegisterChild()

void OmegaEngine.EngineElement.RegisterChild ( EngineElement  element,
bool  autoDispose = true 
)
inlineprotected

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

Parameters
elementThe EngineElement to register. Silently ignores null.
autoDisposeControls whether the element is automatically disposed when Dispose is called.

◆ UnregisterChild()

void OmegaEngine.EngineElement.UnregisterChild ( EngineElement  element)
inlineprotected

Unregisters a child EngineElement (opposite of RegisterChild).

Parameters
elementThe EngineElement to unregister. Silently ignores null.

Member Data Documentation

◆ IsEngineSet

bool OmegaEngine.EngineElement.IsEngineSet => _engine != null

true if the Engine has been set.

Property Documentation

◆ Engine

Engine OmegaEngine.EngineElement.Engine
getset

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

Exceptions
InvalidOperationExceptionTrying to read the engine before it has been set.

◆ IsDisposed

bool OmegaEngine.EngineElement.IsDisposed
get

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


The documentation for this class was generated from the following file: