Module util

Assorted utility functions

Global Functions

newweaktable () Creates a new weak-keyed table
copy (t) Copies a given table This works by creating a new table, iterating t, and setting the key-value pairs in the new table.
merge (a, b) Merges key-value pairs from table b onto a copy of table a.
map_real (...) Maps all bound object inputs to their corresponding userdata
ticks () Returns the number of milliseconds since the engine booted.
frame_ticks () Returns the number of milliseconds since the last frame was rendered.


Global Functions

Global Functions.
newweaktable ()
Creates a new weak-keyed table

Returns:

    A new weak-keyed table
copy (t)
Copies a given table This works by creating a new table, iterating t, and setting the key-value pairs in the new table. This does not modify t.

Parameters:

  • t table The table to be copied

Returns:

    The newly copied table, or nil if t is nil
merge (a, b)
Merges key-value pairs from table b onto a copy of table a. This does not modify a or b.

Parameters:

  • a table The table to be copied and overwritten
  • b table The table with which to overwrite values

Returns:

    A new merged table
map_real (...)
Maps all bound object inputs to their corresponding userdata

Parameters:

  • ... Variable list of bound objects

Returns:

    Variable list of userdata
ticks ()
Returns the number of milliseconds since the engine booted.

Returns:

    number
frame_ticks ()
Returns the number of milliseconds since the last frame was rendered.

Returns:

    number
generated by LDoc 1.3.12