GameTime
Extends:
Static Method Summary
| Static Public Methods | ||
| public static |
|
|
| public static |
getSchema(): {"timeSeconds": *, "speed": *, "realtimeSeconds": *} |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(root: GameRoot) |
|
Member Summary
| Public Members | ||
| public |
|
|
| public |
|
|
| public |
|
|
| public |
root: * |
|
| public |
|
|
| public |
|
|
Method Summary
| Public Methods | ||
| public |
deserialize(data: *): * |
|
| public |
getIsPaused(): * |
|
| public |
Returns if we are currently in the grace period |
|
| public |
Returns how many seconds we are in the grace period |
|
| public |
getSpeed(): * |
|
| public |
getTimeMs(): * Returns the ingame time in milliseconds |
|
| public |
internalAddDeltaToBudget(deltaMs: number) Internal method to generate new logic time budget |
|
| public |
Returns ingame time in seconds |
|
| public |
performTicks(deltaMs: number, updateMethod: function(): boolean) Performs update ticks based on the queued logic budget |
|
| public |
Returns "real" time in seconds |
|
| public |
setSpeed(speed: *) |
|
| public |
Returns "real" time in seconds |
|
| public |
Fetches the new "real" time, called from the core once per frame, since performance now() is kinda slow |
|
Inherited Summary
| From class BasicSerializableObject | ||
| public static |
|
|
| public static |
getId() |
|
| public static |
Should return the serialization schema |
|
| public static |
|
|
| public |
deserialize(data: any, root: import("./savegame_serializer").GameRoot): string | void |
|
| public |
|
|
Static Public Methods
public static getSchema(): {"timeSeconds": *, "speed": *, "realtimeSeconds": *} source
Should return the serialization schema
Override:
BasicSerializableObject#getSchemaReturn:
| {"timeSeconds": *, "speed": *, "realtimeSeconds": *} |
Public Constructors
public constructor(root: GameRoot) source
Fixes typeof DerivedComponent is not assignable to typeof Component, compiled out in non-dev builds
Override:
BasicSerializableObject#constructorParams:
| Name | Type | Attribute | Description |
| root | GameRoot |
Public Methods
public deserialize(data: *): * source
Override:
BasicSerializableObject#deserializeParams:
| Name | Type | Attribute | Description |
| data | * |
Return:
| * |
public getRemainingGracePeriodSeconds(): number source
Returns how many seconds we are in the grace period
public internalAddDeltaToBudget(deltaMs: number) source
Internal method to generate new logic time budget
Params:
| Name | Type | Attribute | Description |
| deltaMs | number |
public performTicks(deltaMs: number, updateMethod: function(): boolean) source
Performs update ticks based on the queued logic budget
public setSpeed(speed: *) source
Params:
| Name | Type | Attribute | Description |
| speed | * |
public updateRealtimeNow() source
Fetches the new "real" time, called from the core once per frame, since performance now() is kinda slow
