Quantum 3 3.1.0

Public Member Functions | Properties | List of all members
Quantum.SystemMainThreadFilter< T > Class Template Referenceabstract

This type of system uses a FilterStruct of type T to filter a set of entities based on it, loop through them and calls a method. More...

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

Public Member Functions

sealed override void Update (Frame frame)
 Internal update method, use Update(Frame, ref T) instead. More...
 
abstract void Update (Frame frame, ref T filter)
 Override to add workload. More...
 
- Public Member Functions inherited from Quantum.SystemMainThread
 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...
 
- Public Member Functions inherited from Quantum.SystemBase
 SystemBase ()
 Constructor. More...
 
 SystemBase (params SystemBase[] children)
 Create a new instance of a system with children. More...
 
 SystemBase (string scheduleSample)
 Create a new instance and setting the sample name. More...
 
virtual void OnDisabled (Frame frame)
 Is called when the system was disabled for example after Frame.SystemDisable(Type). More...
 
virtual void OnEnabled (Frame frame)
 Is called when the system was enabled for example after calling Frame.SystemEnable<T>() or during QuantumGame.InitSystems(Photon.Deterministic.DeterministicFrame). 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. Exceptions thrown by the children are thrown at the end of Frame.ScheduleSystems, so the task handles of the other children are kept. More...
 

Properties

virtual ComponentSet Any [get]
 A filter to include components from the iteration. More...
 
virtual bool UseCulling [get]
 Override to change the if the filter should exclude culled entities. More...
 
virtual ComponentSet Without [get]
 A filter to exclude components from the iteration. More...
 
- Properties inherited from Quantum.SystemBase
IEnumerable< SystemBase > ChildSystems [get]
 The enumerable child systems. More...
 
IEnumerable< SystemBase > Hierarchy [get]
 Creates the complete sub graph of child systems. More...
 
SystemBase ParentSystem [get]
 The parent system in the system hierarchy. More...
 
string ProfilerName [get]
 Profiler 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...
 

Additional Inherited Members

- Protected Member Functions inherited from Quantum.SystemMainThread
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...
 

Detailed Description

This type of system uses a FilterStruct of type T to filter a set of entities based on it, loop through them and calls a method.

The Any and Without virtual functions can be overwritten for more advanced filtering.

If more complex options are required, inherit from SystemMainThread and iterate through the filters manually.

Always register new system types on the SystemsConfig.

public unsafe class FooSystem : SystemMainThreadFilter{Foo.Filter} {
public struct Filter {
public EntityRef Entity;
public Foo* FooComponent;
}
public override void Update(Frame frame, ref Filter filter) {
filter.FooComponent->Update(frame, filter.Entity);
}
}
Template Parameters
TFilter type
Type Constraints
T :unmanaged 

Member Function Documentation

◆ Update() [1/2]

sealed override void Quantum.SystemMainThreadFilter< T >.Update ( Frame  frame)
inlinevirtual

Internal update method, use Update(Frame, ref T) instead.

Parameters
frameThe current frame.

Implements Quantum.SystemMainThread.

◆ Update() [2/2]

abstract void Quantum.SystemMainThreadFilter< T >.Update ( Frame  frame,
ref T  filter 
)
pure virtual

Override to add workload.

Parameters
frameThe current frame.
filterThe frame object.

Property Documentation

◆ UseCulling

virtual bool Quantum.SystemMainThreadFilter< T >.UseCulling
get

Override to change the if the filter should exclude culled entities.

◆ Without

virtual ComponentSet Quantum.SystemMainThreadFilter< T >.Without
get

A filter to exclude components from the iteration.

◆ Any

A filter to include components from the iteration.

Quantum.SystemMainThreadFilter.Update
sealed override void Update(Frame frame)
Internal update method, use Update(Frame, ref T) instead.
Definition: SystemMainThreadFilter.cs:51