Quantum 3 3.0.14

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 f)
 Internal update method, use Update(Frame, ref T) instead. More...
 
abstract void Update (Frame f, 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 f)
 Is called when the system was disabled for example after Frame.SystemDisable(Type). More...
 
virtual void OnEnabled (Frame f)
 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 f)
 Is called when the system is initialized. More...
 
TaskHandle OnSchedule (Frame f, TaskHandle taskHandle)
 Creates the task graph for the system. 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< SystemBaseChildSystems [get]
 The enumerable child systems. More...
 
IEnumerable< SystemBaseHierarchy [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 f, TaskHandle taskHandle)
 Override to add additional tasks. More...
 
TaskHandle ScheduleUpdate (Frame f, 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 f, ref Filter filter) {
filter.FooComponent->Update(f, filter.Entity);
}
}
Template Parameters
TFilter type
Type Constraints
T :unmanaged 

Member Function Documentation

◆ Update() [1/2]

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

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

Parameters
fThe current frame.

Implements Quantum.SystemMainThread.

◆ Update() [2/2]

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

Override to add workload.

Parameters
fThe 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 f)
Internal update method, use Update(Frame, ref T) instead.
Definition: SystemMainThreadFilter.cs:51