Recorder

Records input of an Input type (Mouse or Keyboard).

Input type must define a BaseState type defining all state to be recorded (all input state in Input should be either in BaseState or calculated from BaseState data).

Data is recorded by passing a buffer to a Recorder constructor, and repeatedly checking if there's enough space using notEnoughSpace(), recording input using recordFrame() when there's enough space and dumping or copying recordedData() followed by a reset() when there's not enough space.

Constructors

this
this(ubyte[] storage)

Construct a Recorder with specified storage buffer.

Members

Functions

notEnoughSpace
bool notEnoughSpace()

If true, there is not enough space to continue recording. Must be checked by user.

recordFrame
void recordFrame(const(Input) input)

Record input from a frame (game update).

recordedData
const(ubyte)[] recordedData()

Get the (raw binary) data recorded so far.

reset
void reset()

Reset the recorder, clearing recorded data and reusing the storage buffer.

Meta