Quantum 3 3.1.0

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

Most common Quantum system type. Implements a regular Update() with all the usual features. More...

Inheritance diagram for Quantum.SystemMainThread:
Quantum.SystemBase Quantum.Core.PlayerConnectedSystem Quantum.SystemMainThreadFilter< T >

Public Member Functions

 SystemMainThread ()
 Create a new system. More...
 
 SystemMainThread (params SystemBase[] children)
 Create a new main thread system with children. More...
 
 SystemMainThread (string name)
 Create a new system with a custom name. Unused, will be removed in future versions. More...
 
abstract void Update (Frame frame)
 Override to add workload. More...
 
- Public Member Functions inherited from Quantum.SystemBase
 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

override TaskHandle Schedule (Frame frame, TaskHandle taskHandle)
 Override to add additional tasks. More...
 
TaskHandle ScheduleUpdate (Frame frame, TaskHandle taskHandle)
 Adds the basic update callback. More...
 

Additional Inherited Members

- Properties inherited from Quantum.SystemBase
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

Most common Quantum system type. Implements a regular Update() with all the usual features.

Always register new system types on the SystemsConfig.

Constructor & Destructor Documentation

◆ SystemMainThread() [1/3]

Quantum.SystemMainThread.SystemMainThread ( )
inline

Create a new system.

◆ SystemMainThread() [2/3]

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

Create a new main thread system with children.

Parameters
children

◆ SystemMainThread() [3/3]

Quantum.SystemMainThread.SystemMainThread ( string  name)
inline

Create a new system with a custom name. Unused, will be removed in future versions.

Parameters
nameThe system name shows up in the task profiler for example.

Member Function Documentation

◆ ScheduleUpdate()

TaskHandle Quantum.SystemMainThread.ScheduleUpdate ( Frame  frame,
TaskHandle  taskHandle 
)
inlineprotected

Adds the basic update callback.

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

◆ Schedule()

override TaskHandle Quantum.SystemMainThread.Schedule ( Frame  frame,
TaskHandle  taskHandle 
)
inlineprotectedvirtual

Override to add additional tasks.

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

Implements Quantum.SystemBase.

◆ Update()

abstract void Quantum.SystemMainThread.Update ( Frame  frame)
pure virtual

Override to add workload.

Parameters
frameThe current fame.

Implemented in Quantum.SystemMainThreadFilter< T >, and Quantum.Core.PlayerConnectedSystem.