Quantum 3 3.1.0

Public Member Functions | Protected Member Functions | Properties | List of all members
Quantum.SystemBase Class Referenceabstract

The Quantum system base class. More...

Inheritance diagram for Quantum.SystemBase:
Quantum.Core.CullingSystem2D Quantum.Core.CullingSystem3D Quantum.Core.NavigationSystem Quantum.Core.PhysicsSystem2D Quantum.Core.PhysicsSystem3D Quantum.SystemGroup Quantum.SystemMainThread Quantum.SystemMainThreadGroup Quantum.SystemSignalsOnly Quantum.Task.SystemArrayComponent< T > Quantum.Task.SystemArrayFilter< T > Quantum.Task.SystemThreadedComponent< T > Quantum.Task.SystemThreadedFilter< T >

Public Member Functions

 SystemBase ()
 Create a new instance of a system without children. More...
 
 SystemBase (params SystemBase[] children)
 Create a new instance of a system with children. More...
 
 SystemBase (string scheduleSample)
 Create a new instance of a system without children. More...
 
void Disable (Frame frame)
 
void Enable (Frame frame)
 
bool IsEnabledInHierarchy (Frame frame)
 
bool IsEnabledSelf (Frame frame)
 
virtual void OnDisabled (Frame frame)
 Is called when the system was disabled, for example after calling Frame.SystemDisable(Type). The base implementation calls OnDisabled on the child systems that are enabled themselves. More...
 
virtual void OnEnabled (Frame frame)
 Is called when the system was enabled, for example after calling Frame.SystemEnable<T>() or when the game starts with StartEnabled set. The base implementation calls OnEnabled on the child systems that are enabled themselves. More...
 
virtual void OnInit (Frame frame)
 Is called when the system is initialized. More...
 
virtual void OnResync (Frame frame)
 Is called when the simulation is about to start from a snapshot. More...
 
TaskHandle OnSchedule (Frame frame, TaskHandle taskHandle)
 Creates the task graph for the system by calling Schedule and then scheduling the enabled child systems. Exceptions thrown by the children are collected and thrown after all systems were scheduled, so the task handles of the other children are kept. More...
 

Protected Member Functions

abstract TaskHandle Schedule (Frame frame, TaskHandle taskHandle)
 Override to add tasks to this system. More...
 

Properties

IEnumerable< SystemBase > ChildSystems [get]
 The direct child systems of this system. More...
 
IEnumerable< SystemBase > Hierarchy [get]
 Enumerates this system and all of its descendants, depth-first. More...
 
SystemBase ParentSystem [get]
 The parent system in the system hierarchy. More...
 
string ProfilerName [get]
 The name of the system in the profiler, defaults to the type name. More...
 
Int32 RuntimeIndex [get]
 A unique index assigned to identify systems at runtime. More...
 
virtual Boolean StartEnabled [get, set]
 Set to true when the simulation should start with this system enabled. More...
 

Detailed Description

The Quantum system base class.

Only advised for advanced use cases.

Constructor & Destructor Documentation

◆ SystemBase() [1/3]

Quantum.SystemBase.SystemBase ( )
inline

Create a new instance of a system without children.

◆ SystemBase() [2/3]

Quantum.SystemBase.SystemBase ( string  scheduleSample)
inline

Create a new instance of a system without children.

Parameters
scheduleSampleNot used anymore, the profiler uses the type name.

◆ SystemBase() [3/3]

Quantum.SystemBase.SystemBase ( params SystemBase[]  children)
inline

Create a new instance of a system with children.

Parameters
childrenThe child systems, they are enabled and disabled together with this system.

Member Function Documentation

◆ Disable()

void Quantum.SystemBase.Disable ( Frame  frame)
Parameters
frameThe referenced frame.

◆ Enable()

void Quantum.SystemBase.Enable ( Frame  frame)
Parameters
frameThe referenced frame.

◆ IsEnabledSelf()

bool Quantum.SystemBase.IsEnabledSelf ( Frame  frame)
Parameters
frameThe referenced frame.

◆ IsEnabledInHierarchy()

bool Quantum.SystemBase.IsEnabledInHierarchy ( Frame  frame)
Parameters
frameThe referenced frame.

◆ OnInit()

virtual void Quantum.SystemBase.OnInit ( Frame  frame)
inlinevirtual

◆ OnResync()

virtual void Quantum.SystemBase.OnResync ( Frame  frame)
inlinevirtual

Is called when the simulation is about to start from a snapshot.

Parameters
frameThe referenced frame.

◆ OnEnabled()

virtual void Quantum.SystemBase.OnEnabled ( Frame  frame)
inlinevirtual

Is called when the system was enabled, for example after calling Frame.SystemEnable<T>() or when the game starts with StartEnabled set. The base implementation calls OnEnabled on the child systems that are enabled themselves.

Parameters
frameThe referenced frame.

◆ OnDisabled()

virtual void Quantum.SystemBase.OnDisabled ( Frame  frame)
inlinevirtual

Is called when the system was disabled, for example after calling Frame.SystemDisable(Type). The base implementation calls OnDisabled on the child systems that are enabled themselves.

Parameters
frameThe referenced frame.

◆ OnSchedule()

TaskHandle Quantum.SystemBase.OnSchedule ( Frame  frame,
TaskHandle  taskHandle 
)
inline

Creates the task graph for the system by calling Schedule and then scheduling the enabled child systems. Exceptions thrown by the children are collected and thrown after all systems were scheduled, so the task handles of the other children are kept.

Parameters
frameThe referenced frame.
taskHandleThe initial task handle.
Returns
The system task graph.

◆ Schedule()

abstract TaskHandle Quantum.SystemBase.Schedule ( Frame  frame,
TaskHandle  taskHandle 
)
protectedpure virtual

Property Documentation

◆ RuntimeIndex

Int32 Quantum.SystemBase.RuntimeIndex
get

A unique index assigned to identify systems at runtime.

◆ ParentSystem

SystemBase Quantum.SystemBase.ParentSystem
get

The parent system in the system hierarchy.

◆ ChildSystems

IEnumerable<SystemBase> Quantum.SystemBase.ChildSystems
get

The direct child systems of this system.

◆ Hierarchy

IEnumerable<SystemBase> Quantum.SystemBase.Hierarchy
get

Enumerates this system and all of its descendants, depth-first.

◆ StartEnabled

virtual Boolean Quantum.SystemBase.StartEnabled
getset

Set to true when the simulation should start with this system enabled.

◆ ProfilerName

string Quantum.SystemBase.ProfilerName
getprotected

The name of the system in the profiler, defaults to the type name.