Skip to content

1681-engine / index / InputRecorder

Class: InputRecorder<A> ​

Defined in: src/input/inputTape.ts:29

Records an Actions' every step until stopped.

ts
const rec = new InputRecorder(actions, { seed, level: 'forest-2' });
// … play …
const tape = rec.stop(); // JSON.stringify it into the bug report

Type Parameters ​

Type Parameter
A extends string

Constructors ​

Constructor ​

ts
new InputRecorder<A>(actions, meta?): InputRecorder<A>;

Defined in: src/input/inputTape.ts:38

Parameters ​

ParameterType
actionsActions<A>
meta?Record<string, unknown>

Returns ​

InputRecorder<A>

Accessors ​

length ​

Get Signature ​

ts
get length(): number;

Defined in: src/input/inputTape.ts:46

Steps recorded so far.

Returns ​

number

Methods ​

stop() ​

ts
stop(): InputTape;

Defined in: src/input/inputTape.ts:51

Stops recording and returns the tape (the same one on every later call).

Returns ​

InputTape

Released under the MIT License.