Nebula
Loading...
Searching...
No Matches
Nebula.Game.TimeSource Class Reference

Detailed Description

A time source.

The values are the mirror's copy of the native source, refreshed once per frame at the beginning of the frame, so reading them is a field read rather than a call through the api.

A source appears in the mirror after the first sync, and the engine has authority over the time.

Public Member Functions

void Pause ()
void Resume ()

Package Functions

 TimeSource (uint hash)
void Update (in TimeSourceSnapshot entry)

Properties

int AvailableSteps [get, private set]
uint Hash [get]
double FrameTime [get, set]
double Time [get, set]
long Ticks [get, set]
double FixedFrameTime [get, set]
double Accumulator [get, set]
int MaxStepsPerFrame [get, set]
float TimeFactor [get, set]
 How fast this source runs relative to the frame time.
int PauseCounter [get, set]
 Increment to pause this source, decrement to let it run again.
bool IsPaused [get]

Private Attributes

readonly uint hash
float timeFactor
int pauseCounter

Constructor & Destructor Documentation

◆ TimeSource()

Nebula.Game.TimeSource.TimeSource ( uint hash)
inlinepackage

Member Function Documentation

◆ Pause()

void Nebula.Game.TimeSource.Pause ( )
inline

◆ Resume()

void Nebula.Game.TimeSource.Resume ( )
inline

◆ Update()

void Nebula.Game.TimeSource.Update ( in TimeSourceSnapshot entry)
inlinepackage

Member Data Documentation

◆ hash

readonly uint Nebula.Game.TimeSource.hash
private

◆ pauseCounter

int Nebula.Game.TimeSource.pauseCounter
private

◆ timeFactor

float Nebula.Game.TimeSource.timeFactor
private

Property Documentation

◆ Accumulator

double Nebula.Game.TimeSource.Accumulator
getset

◆ AvailableSteps

int Nebula.Game.TimeSource.AvailableSteps
getprivate setpackage

◆ FixedFrameTime

double Nebula.Game.TimeSource.FixedFrameTime
getset

◆ FrameTime

double Nebula.Game.TimeSource.FrameTime
getset

◆ Hash

uint Nebula.Game.TimeSource.Hash
get

◆ IsPaused

bool Nebula.Game.TimeSource.IsPaused
get

◆ MaxStepsPerFrame

int Nebula.Game.TimeSource.MaxStepsPerFrame
getset

◆ PauseCounter

int Nebula.Game.TimeSource.PauseCounter
getset

Increment to pause this source, decrement to let it run again.

A paused source does not advance and has no steps available.

◆ Ticks

long Nebula.Game.TimeSource.Ticks
getset

◆ Time

double Nebula.Game.TimeSource.Time
getset

◆ TimeFactor

float Nebula.Game.TimeSource.TimeFactor
getset

How fast this source runs relative to the frame time.

The write goes through the api and the mirror keeps the same value, so a read in the same frame agrees with what was just written.


The documentation for this class was generated from the following file:
  • /github/workspace/code/addons/nsharp/NebulaEngine/engine/TimeSource.cs