Table of Contents

Class SimulationSystem

Namespace
NominalSystems.Core
Assembly
NominalSystems.Core.dll

[NominalSystems] A implementable per-simulation object system

public abstract class SimulationSystem
Inheritance
SimulationSystem
Derived

Constructors

SimulationSystem()

Default constructor

public SimulationSystem()

Fields

IsEnabled

Is 'SimulationSystem' enabled

public bool IsEnabled

Field Value

bool

Properties

ID

The event listener's ID

public Guid ID { get; }

Property Value

Guid

Simulation

The default 'Simulation' object

public Simulation Simulation { get; }

Property Value

Simulation

Methods

AddDelayEvent(Action, double)

Add a new simulation delay event (seconds)

public Guid AddDelayEvent(Action func, double seconds = 0)

Parameters

func Action

the event delegate

seconds double

the delay amount (seconds)

Returns

Guid

the event guid

AddDelayEvent(Action<double>, double)

Add a new simulation delay event (seconds)

public Guid AddDelayEvent(Action<double> func, double seconds = 0)

Parameters

func Action<double>

the event delegate

seconds double

the delay amount (seconds)

Returns

Guid

the event guid

AddRepeatEvent(Action, double)

Add a new simulation repeat event (seconds)

public Guid AddRepeatEvent(Action func, double seconds = 0)

Parameters

func Action

the event delegate

seconds double

the repeat amount (seconds)

Returns

Guid

the event guid

AddRepeatEvent(Action<double, double>, double)

Add a new simulation repeat event (seconds)

public Guid AddRepeatEvent(Action<double, double> func, double seconds = 0)

Parameters

func Action<double, double>

the event delegate

seconds double

the repeat amount (seconds)

Returns

Guid

the event guid

AddRepeatEvent(Action<double>, double)

Add a new simulation repeat event (seconds)

public Guid AddRepeatEvent(Action<double> func, double seconds = 0)

Parameters

func Action<double>

the event delegate

seconds double

the repeat amount (seconds)

Returns

Guid

the event guid

Add<T>()

Add a 'Component' object - from a system type

public T Add<T>() where T : Component, new()

Returns

T

the 'Component' object

Type Parameters

T

Exceptions

ArgumentNullException
NotSupportedException

FindComponent<T>(bool)

public T FindComponent<T>(bool recurse = true) where T : Component

Parameters

recurse bool

Returns

T

Type Parameters

T

FindComponents<T>(bool)

public T[] FindComponents<T>(bool recurse = true) where T : Component

Parameters

recurse bool

Returns

T[]

Type Parameters

T

GetSystem<T>()

public T GetSystem<T>() where T : SimulationSystem, new()

Returns

T

Type Parameters

T

OnBegin(double)

Called when the 'SimulationSystem' is beginning

[Event(EventType.Default)]
protected virtual void OnBegin(double time)

Parameters

time double

elapsed time (seconds)

OnDecodeMetadata(JObject)

Called after the "SimulationSystem" was loaded to handle additional metadata.

[Event(EventType.Default)]
protected virtual void OnDecodeMetadata(JObject metadata)

Parameters

metadata JObject

OnEncodeMetadata(JObject)

Called while the "SimulationSystem" is being saved to save additional metadata.

[Event(EventType.Default)]
protected virtual JObject OnEncodeMetadata(JObject jobj)

Parameters

jobj JObject

Returns

JObject

OnFinish(double)

Called when the 'SimulationSystem' is finishing

[Event(EventType.Default)]
protected virtual void OnFinish(double time)

Parameters

time double

elapsed time (seconds)

OnReset(double)

Called when the 'SimulationSystem' is resetting

[Event(EventType.Default)]
protected virtual void OnReset(double time)

Parameters

time double

reset time (seconds)

OnUpdate(double, double)

Called when the 'SimulationSystem' should update

[Event(EventType.Default)]
protected virtual void OnUpdate(double time, double step)

Parameters

time double

elapsed time (seconds)

step double

the time step (seconds)

RemoveComponent<T>(T)

public void RemoveComponent<T>(T component) where T : Component

Parameters

component T

Type Parameters

T

StopEvent(Guid)

Stop the simulation event from running

public void StopEvent(Guid id)

Parameters

id Guid

a event id