MiniQuake2

src/miniquake2/game/persistence.ml

Provides miniquake2 game persistence facilities for this project.

Package
miniquake2.game.persistence
Reachable
Yes

Imports

Declarations

decode

function decode(data, maxEdicts)

Decode state.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
maxEdictsdynamic—maxEdicts value consumed by this operation.

View source

decodeSaveImage

function decodeSaveImage(data, maxEdicts)

Decode save image.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.
maxEdictsdynamic—maxEdicts value consumed by this operation.

View source

encode

function encode(exportTable, kind, mapName, frameNumber)

Encodes encode for the miniquake2 game persistence workflow.

ParameterTypeDefaultDescription
exportTabledynamic—exportTable value consumed by this operation.
kinddynamic—kind value consumed by this operation.
mapNamedynamic—mapName value consumed by this operation.
frameNumberdynamic—frameNumber value consumed by this operation.

View source

encodeSaveImageWithPrivate

function encodeSaveImageWithPrivate(exportTable, kind, mapName, frameNumber, privateData)

Encode save image with private.

ParameterTypeDefaultDescription
exportTabledynamic—exportTable value consumed by this operation.
kinddynamic—kind value consumed by this operation.
mapNamedynamic—mapName value consumed by this operation.
frameNumberdynamic—frameNumber value consumed by this operation.
privateDatadynamic—privateData value consumed by this operation.

View source

encodeWithPrivate

function encodeWithPrivate(exportTable, kind, mapName, frameNumber, privateData)

Encode with private.

ParameterTypeDefaultDescription
exportTabledynamic—exportTable value consumed by this operation.
kinddynamic—kind value consumed by this operation.
mapNamedynamic—mapName value consumed by this operation.
frameNumberdynamic—frameNumber value consumed by this operation.
privateDatadynamic—privateData value consumed by this operation.

View source

readEntityState

function readEntityState(buffer, expectedNumber)

Read entity state.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
expectedNumberdynamic—expectedNumber value consumed by this operation.

View source

readFile

function readFile(filename, maxEdicts)

Read file.

ParameterTypeDefaultDescription
filenamedynamic—filename value consumed by this operation.
maxEdictsdynamic—maxEdicts value consumed by this operation.

View source

readFloat

function readFloat(buffer, operation)

Read float.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
operationdynamic—operation value consumed by this operation.

View source

readPlayerState

function readPlayerState(buffer)

Read player state.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.

View source

readPmoveState

function readPmoveState(buffer)

Read pmove state.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.

View source

readVec3

function readVec3(buffer, operation)

Read vec 3.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
operationdynamic—operation value consumed by this operation.

View source

SAVE_MAGIC

const SAVE_MAGIC = "MQ2SAVE1"

Defines the save magic constant used by the miniquake2 game persistence module.

View source

SAVE_VERSION

const SAVE_VERSION = 2

Defines the save version constant used by the miniquake2 game persistence module.

View source

saveFormat

function saveFormat(data)

Save format.

ParameterTypeDefaultDescription
datadynamic—Input data consumed by the operation.

View source

miniquake2.game.persistence.SaveImage struct

writeEntityState

function writeEntityState(buffer, state)

Write entity state.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
statedynamic—Mutable state inspected or updated by the operation.

View source

writeFile

function writeFile(exportTable, kind, mapName, frameNumber, filename)

Write file.

ParameterTypeDefaultDescription
exportTabledynamic—exportTable value consumed by this operation.
kinddynamic—kind value consumed by this operation.
mapNamedynamic—mapName value consumed by this operation.
frameNumberdynamic—frameNumber value consumed by this operation.
filenamedynamic—filename value consumed by this operation.

View source

writeFileWithPrivate

function writeFileWithPrivate(exportTable, kind, mapName, frameNumber, privateData, filename)

Write file with private.

ParameterTypeDefaultDescription
exportTabledynamic—exportTable value consumed by this operation.
kinddynamic—kind value consumed by this operation.
mapNamedynamic—mapName value consumed by this operation.
frameNumberdynamic—frameNumber value consumed by this operation.
privateDatadynamic—privateData value consumed by this operation.
filenamedynamic—filename value consumed by this operation.

View source

writePlayerState

function writePlayerState(buffer, state)

Write player state.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
statedynamic—Mutable state inspected or updated by the operation.

View source

writePmoveState

function writePmoveState(buffer, state)

Write pmove state.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
statedynamic—Mutable state inspected or updated by the operation.

View source

writeVec3

function writeVec3(buffer, value)

Write vec 3.

ParameterTypeDefaultDescription
bufferdynamic—Buffer that receives or supplies the operation data.
valuedynamic—Value consumed or transformed by the operation.

View source