add binser docs

This commit is contained in:
Jill 2022-09-22 18:42:15 +03:00
parent 09148da26f
commit 92cf8ff468
2 changed files with 17 additions and 1 deletions

View File

@ -93,6 +93,7 @@ Uranium Template originally formed during the creation of a currently unreleased
- [`scheduler.scheduleInTicks(when: number, func: function): number`](#schedulerscheduleintickswhen-number-func-function-number)
- [`scheduler.unschedule(i: index): void`](#schedulerunschedulei-index-void)
- [`scheduler.unscheduleInTicks(i: index): void`](#schedulerunscheduleinticksi-index-void)
- [`binser`](#binser)
- [`rng`](#rng)
- [`rng.init(seed: number[] | nil): rng`](#rnginitseed-number--nil-rng)
- [`rng(a: number | nil, b: number | nil): number`](#rnga-number--nil-b-number--nil-number)
@ -788,6 +789,21 @@ Unschedules a function. Use the index returned to you when originally scheduling
Unschedules a function in ticks. Use the index returned to you when originally scheduling the function.
### `binser`
A NITG port of [binser](https://github.com/bakpakin/binser). Used for savedata serialization.
```lua
local binser = require('stdlib.binser')
local mydata = binser.serialize(45, {4, 8, 12, 16}, 'Hello, World!')
print(binser.deserializeN(mydata, 3))
-- 45 table: 0x7fa60054bdb0 Hello, World!
```
If you want to serialize custom types using the savedata module, check binser's [Custom types](https://github.com/bakpakin/binser#custom-types) section.
### `rng`
A xoshiro128** reimplementation in Lua.

@ -1 +1 @@
Subproject commit 0763d750ff574e0df75943b036b357428dd9158c
Subproject commit a6f17c0f2ad70ef80cd56399e479c8c9261d10ba