Class Component
- Namespace
- NominalSystems.Core
- Assembly
- NominalSystems.Core.dll
[NominalSystems] The base class for all simulation components
public abstract class Component
- Inheritance
-
Component
- Derived
Constructors
Component()
Construct a 'Component' object
public Component()
Fields
IsEnabled
Is the 'Component' enabled
public bool IsEnabled
Field Value
Properties
ID
The event listener's ID
public Guid ID { get; }
Property Value
IsRunning
Is the 'Component' still running
public bool IsRunning { 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
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
Destroy(double)
public void Destroy(double t)
Parameters
t
double
FindObjectWithID(Guid)
public IObject FindObjectWithID(Guid guid)
Parameters
guid
Guid
Returns
FindObjectWithID<T>(Guid)
public T FindObjectWithID<T>(Guid guid) where T : IObject
Parameters
guid
Guid
Returns
- T
Type Parameters
T
FindObjectWithType<T>()
protected IObject FindObjectWithType<T>() where T : Component
Returns
Type Parameters
T
FindObjectsWithType<T>()
protected IObject[] FindObjectsWithType<T>() where T : Component
Returns
- IObject[]
Type Parameters
T
GetChild<T>(bool)
public T GetChild<T>(bool recurse = true) where T : Component
Parameters
recurse
bool
Returns
- T
Type Parameters
T
GetChildren<T>(bool)
public T[] GetChildren<T>(bool recurse = true) where T : Component
Parameters
recurse
bool
Returns
- T[]
Type Parameters
T
GetModel<T>()
public T GetModel<T>() where T : ComponentModel, new()
Returns
- T
Type Parameters
T
GetParent<T>(bool)
public T GetParent<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
IsChildTypeSupported(Type)
Returns true if 'Component' type is a supported child
protected virtual bool IsChildTypeSupported(Type type)
Parameters
type
Typea 'Component' type
Returns
IsModelTypeSupported(Type)
Returns true if 'ComponentModel' type is supported model
protected virtual bool IsModelTypeSupported(Type type)
Parameters
type
Typea 'ComponentModel' type
Returns
OnBegin(double)
Called when the 'Component' is beginning
[Event(EventType.Default)]
protected virtual void OnBegin(double time)
Parameters
time
doublecurrent time (seconds)
OnDecodeMetadata(JObject)
Called after the "Component" was loaded to handle additional metadata.
[Event(EventType.Default)]
protected virtual void OnDecodeMetadata(JObject metadata)
Parameters
metadata
JObject
OnEncodeMetadata(JObject)
Called while the "Component" 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 'Component' is finishing
[Event(EventType.Default)]
protected virtual void OnFinish(double time)
Parameters
time
doublecurrent time (seconds)
OnPostAttachChild(Component)
Called after the 'Component' has attached a component
protected virtual void OnPostAttachChild(Component child)
Parameters
child
ComponentThe child component
OnPostDetachChild(Component)
Called after the 'Component' has detached a component
protected virtual void OnPostDetachChild(Component child)
Parameters
child
ComponentThe child component
OnPreAttachChild(Component)
Called before the 'Component' attaches a component
protected virtual void OnPreAttachChild(Component child)
Parameters
child
ComponentThe child component
OnPreDetachChild(Component)
Called before the 'Component' detaches a component
protected virtual void OnPreDetachChild(Component child)
Parameters
child
ComponentThe child component
OnReset(double)
Called when the 'Component' is reset from a simulation
[Event(EventType.Default)]
protected virtual void OnReset(double time)
Parameters
time
doublereset time (seconds)
OnUpdate(double, double)
Called when the 'Component' should update
[Event(EventType.Default)]
protected virtual void OnUpdate(double time, double step)
Parameters
RemoveChild<T>(T)
public void RemoveChild<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
Guida event id