# Class: InputRecording

Defined in: [dev/src/replay.ts:131](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/dev/src/replay.ts#L131)

Records input and param changes per simulation tick from page load, so a live session can be turned
into a scenario that replays it exactly (the fixed-step clock and seeded RNG make runs deterministic).
Wraps the input's own methods, so real events, dev hooks and agents are all captured. Dev only.

## Constructors

### Constructor

> **new InputRecording**(`game`, `input`, `checkpoint?`): `InputRecording`

Defined in: [dev/src/replay.ts:142](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/dev/src/replay.ts#L142)

`checkpoint`, when given, is recorded every `CHECKPOINT_EVERY` ticks, just before that tick's step and
after its input: the same moment a scenario reaches after the step's `wait` and input.

#### Parameters

##### game

[`Game`](../../core/classes/Game.md)

##### input

[`DrivableInput`](../interfaces/DrivableInput.md)

##### checkpoint?

() => [`Checkpoint`](../type-aliases/Checkpoint.md)

#### Returns

`InputRecording`

## Accessors

### count

#### Get Signature

> **get** **count**(): `number`

Defined in: [dev/src/replay.ts:268](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/dev/src/replay.ts#L268)

Events recorded so far.

##### Returns

`number`

## Methods

### command()

> **command**(`name`, `args`): `void`

Defined in: [dev/src/replay.ts:298](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/dev/src/replay.ts#L298)

Record a game command (see `DevHooksOptions.commands`) so replays run it at the same tick.

#### Parameters

##### name

`string`

##### args

`unknown`[]

#### Returns

`void`

***

### dispose()

> **dispose**(): `void`

Defined in: [dev/src/replay.ts:293](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/dev/src/replay.ts#L293)

#### Returns

`void`

***

### toReplay()

> **toReplay**(`toTick?`, `name?`): [`Replay`](../interfaces/Replay.md)

Defined in: [dev/src/replay.ts:278](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/dev/src/replay.ts#L278)

The session from page load up to `toTick` (default: now) as scenario steps.

#### Parameters

##### toTick?

`number` = `...`

##### name?

`string` = `...`

#### Returns

[`Replay`](../interfaces/Replay.md)

***

### warn()

> **warn**(`message`): `void`

Defined in: [dev/src/replay.ts:273](https://github.com/debuffjp/debuff/blob/4f0ae1091cc5ab837e28b1efc93d4aed7342f621/packages/dev/src/replay.ts#L273)

Note something that makes an exact replay impossible (shown with the replay).

#### Parameters

##### message

`string`

#### Returns

`void`
