Table of Contents

Class UniverseEvent

Namespace
NominalSystems.Universe
Assembly
NominalSystems.Universe.dll

[Nominal] The universe event object is the base object for all universe event types. This includes Universe behaviours, objects, models and systems. This handles the functionality of ticking through the objects as well as managing the event lifetimes.


public abstract class UniverseEvent : Object
Inheritance
UniverseEvent
Derived
Extension Methods

Constructors

UniverseEvent()

Default constructor

protected UniverseEvent()

Fields

IsEnabled

True if the object is currently enabled.

public bool IsEnabled

Field Value

bool

Properties

HasStarted

True if the object has invoked 'OnBegin' function.

[Hidden]
public bool HasStarted { get; }

Property Value

bool

IsRunning

True if the object is running.

[Hidden]
public bool IsRunning { get; }

Property Value

bool

Methods

CreateMessage<T>()

Creates a message of a particular message type and will associate the current event object with the owner of the message.

public T CreateMessage<T>() where T : Message

Returns

T

The message object reference

Type Parameters

T

The message type to create

GetSystem<T>()

Returns a simulation system on the current object, which will fetch the system from the simulation.

public T GetSystem<T>() where T : UniverseSystem

Returns

T

A reference to the simulation system

Type Parameters

T

The simulation system type to fetch

IsA<T>()

Returns true if the current object is of the specified type.

public bool IsA<T>() where T : UniverseEvent

Returns

bool

Type Parameters

T

The universe type

OnBegin(double)

Called when the object is beginning ticking for the first time. This is when the simulation calls the very first tick and will run before the update call.

protected virtual void OnBegin(double time)

Parameters

time double

[s] Current time of the simulation before the tick

OnCreate()

Called when the object is created from the controller and has been attached to the parent object. By this point, it has been registered to the simulation and will run after the constructor.

protected virtual void OnCreate()

OnFinish(double)

Called when the object is deleted from the simulation and can handle any cleanup of variables.

protected virtual void OnFinish(double time)

Parameters

time double

[s] The current clock time when deleted

OnLoad(double)

Called after all of the data has been loaded from a save state on this object. This enables any post-load operations to be performed and extra data to be loaded from the metadata.

protected virtual void OnLoad(double time)

Parameters

time double

[s] The current clock time of the simulation

OnSave()

Called before the object is saved into the save state. This ensures that any additional metadata can be saved on the object before it is automatically serialized.

protected virtual void OnSave()

OnUpdate(double, double)

Called when the object should update from the simulation tick. This will take in a time and a step, where the time is the time of the clock before updating the object.

protected virtual void OnUpdate(double time, double step)

Parameters

time double

[s] Current time of the simulation before the update

step double

[s] The time-step to update during this tick