Skip to main content
Version: 1.2.0

Struct GameTime

Namespace: OblivionMP.SDK.Common.Archetypes.Mixins
Assembly: OblivionMP.SDK.Common.dll

The global world time.

[ArchetypeMixin(Replication.ServerAuthoritative)]
[Extends(typeof(World), "")]
public readonly struct GameTime : IArchetypeMixin, IArchetypeQueryable, IEntityShape

Implements​

IArchetypeMixin, IArchetypeQueryable, IEntityShape

Inherited Members​

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Properties​

Date​

Today's date on the Tamrielic calendar.

public TamrielicDate Date { get; }

Property Value​

TamrielicDate

GameDay​

The days passed since the game started.

public uint GameDay { get; set; }

Property Value​

uint

TimeOfDay​

The current time of day.

public TimeSpan TimeOfDay { get; }

Property Value​

TimeSpan

TimeOfDayMinutes​

The total minutes passed since start of day, 0 to 1440.

public float TimeOfDayMinutes { get; set; }

Property Value​

float

Timescale​

How fast game time runs compared to real time.

public float Timescale { get; set; }

Property Value​

float

Remarks​

Defaults to 30, with 1 in-game minute lasting 2 seconds of real time.

Methods​

Advance(TimeSpan)​

Moves the clock forward, carrying whole days into GameDay.

public void Advance(TimeSpan duration)

Parameters​

duration TimeSpan

Exceptions​

ArgumentOutOfRangeException

duration is negative.

As<T>()​

public T As<T>() where T : struct, IArchetypeQueryable

Returns​

T

Type Parameters​

T

Is<T>()​

public bool Is<T>() where T : struct, IArchetypeQueryable

Returns​

bool

Type Parameters​

T

Keep()​

This entity, which it already is: a loop over this shape hands over the shape itself.

public GameTime Keep()

Returns​

GameTime

Remarks​

Here so taking something out of a loop reads the same whichever way the loop walks. Whether a shape is walked by chunk follows from what it includes, which the call site cannot see and which changes when an include does.

TryAs<T>(out T)​

public bool TryAs<T>(out T archetype) where T : struct, IArchetypeQueryable

Parameters​

archetype T

Returns​

bool

Type Parameters​

T

  • Properties
    • Date
    • GameDay
    • TimeOfDay
    • TimeOfDayMinutes
    • Timescale
  • Methods
    • Advance(TimeSpan)
    • As<T>()
    • Is<T>()
    • Keep()
    • TryAs<T>(out T)