Class Computer
- Namespace
- NominalSystems.Classes
- Assembly
- NominalSystems.Classes.dll
[Nominal] The default computer class is able to connect up software automatically and create functionality for an object.
public class Computer : PhysicalObject
- Inheritance
-
Computer
- Derived
Constructors
Computer()
Default constructor
protected Computer()
Fields
Out_ComputerStatusMsg
The computer status message that outputs the status of the current computer.
public ComputerStatusMessage? Out_ComputerStatusMsg
Field Value
Properties
CurrentState
The current state of the computer based on how much power is being provided to the system
[Unit(UnitType.NONE)]
[ReadOnly]
[Metadata(ContainedIn = "Out_ComputerStatusMsg")]
public ComputerStatusType CurrentState { get; set; }
Property Value
Nanoseconds
The number of nanoseconds since the UNIX Epoch
[Unit(UnitPrefix.NANO, UnitType.SECOND)]
[ReadOnly]
[Metadata(IsAdvanced = true, ContainedIn = "Out_ComputerStatusMsg")]
public long Nanoseconds { get; set; }
Property Value
NumSoftware
The number of software that have been added to the computer.
[Unit(UnitType.NONE)]
[ReadOnly]
public int NumSoftware { get; }
Property Value
Seconds
The number of seconds since the UNIX Epoch
[Unit(UnitType.SECOND)]
[ReadOnly]
[Metadata(ContainedIn = "Out_ComputerStatusMsg")]
public double Seconds { get; set; }
Property Value
Methods
OnBehaviourAttached(UniverseBehaviour)
This event is called when a new behaviour is added to this component. The behaviour is passed into the event and a component can override this method to implement some form of checking when this event is executed.
protected override void OnBehaviourAttached(UniverseBehaviour behaviour)
Parameters
behaviour
UniverseBehaviourA reference to the behaviour that was just added
OnBehaviourDetached(UniverseBehaviour)
This event is called when a behaviour is removed from this component. The behaviour will be passed to the event but it is now no longer attached to this component.
protected override void OnBehaviourDetached(UniverseBehaviour behaviour)
Parameters
behaviour
UniverseBehaviourA reference to the behaviour that was detached
OnCreate()
Called when the 'Component' is created from the controller.
protected override void OnCreate()
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 override void OnLoad(double time)
Parameters
time
double[s] The current clock time of the simulation
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 override 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
SafeMode()
Set the computer into a safe mode - ensuring that only the most important systems are running and the rest are in safety.
public virtual void SafeMode()
Shutdown()
Shut the computer down safely. Disable all software and set the status to SHUTDOWN.
public virtual void Shutdown()
Startup()
Start the computer safely. Enable all software and set the status to RUNNING.
public virtual void Startup()
SyncClock(DateTime)
Syncs the current clock to the datetime as provided as a parameter.
public void SyncClock(DateTime dateTime)
Parameters
dateTime
DateTimeThe datetime to sync to