Class ComponentModel
- Namespace
- NominalSystems.Core
- Assembly
- NominalSystems.Core.dll
[NominalSystems] A implementable per-component object model
public abstract class ComponentModel
- Inheritance
-
ComponentModel
Constructors
ComponentModel()
Default constructor
public ComponentModel()
Fields
IsEnabled
Is 'ComponentModel' enabled
public bool IsEnabled
Field Value
Properties
ID
The event listener's ID
public Guid ID { get; }
Property Value
Target
The parent 'Component' object
public virtual Component Target { get; }
Property Value
Methods
AddDelayEvent(Action, double)
Add a new simulation delay event (seconds)
public Guid AddDelayEvent(Action func, double seconds = 0)
Parameters
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
Returns
- Guid
the event guid
AddRepeatEvent(Action, double)
Add a new simulation repeat event (seconds)
public Guid AddRepeatEvent(Action func, double seconds = 0)
Parameters
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
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
Returns
- Guid
the event guid
GetSystem<T>()
public T GetSystem<T>() where T : SimulationSystem, new()
Returns
- T
Type Parameters
T
OnBegin(double)
Called when the 'ComponentModel' is beginning
[Event(EventType.Default)]
protected virtual void OnBegin(double time)
Parameters
time
doubleelapsed time (seconds)
OnDecodeMetadata(JObject)
Called after the "ComponentModel" was loaded to handle additional metadata.
[Event(EventType.Default)]
protected virtual void OnDecodeMetadata(JObject metadata)
Parameters
metadata
JObject
OnEncodeMetadata(JObject)
Called while the "ComponentModel" is being saved to save additional metadata.
[Event(EventType.Default)]
protected virtual JObject OnEncodeMetadata(JObject metadata)
Parameters
metadata
JObject
Returns
- JObject
OnFinish(double)
Called when the 'ComponentModel' is finishing
[Event(EventType.Default)]
protected virtual void OnFinish(double time)
Parameters
time
doubleelapsed time (seconds)
OnReset(double)
Called when the 'ComponentModel' is resetting
[Event(EventType.Default)]
protected virtual void OnReset(double time)
Parameters
time
doublereset time (seconds)
OnUpdate(double, double)
Called when the 'ComponentModel' should update
[Event(EventType.Default)]
protected virtual void OnUpdate(double time, double step)
Parameters
StopEvent(Guid)
Stop the simulation event from running
public void StopEvent(Guid id)
Parameters
id
Guida event id