# Class: Engine

Defined in: | lib/Engine.coffee

## Overview

The Engine handles how and in which order to execute operations and add operations to the HistoryBuffer.

## Instance Method Summary

- # (void) parseOperation(json) Parses an operatio from the json format.
- # (void) applyOpsBundle(ops_json) Apply a set of operations.
- # (void) applyOpsCheckDouble(ops_json) Same as applyOps but operations that are already in the HB are not applied.
- # (void) applyOps(ops_json) Apply a set of operations.
- # (void) applyOp(op_json) Apply an operation that you received from another peer.
- # (void) tryUnprocessed() Call this method when you applied a new operation.

## Constructor Details

# (void) constructor(HB, parser)

### Parameters:

- HB ( `HistoryBuffer` )
- parser ( `Array` ) — Defines how to parse encoded messages.

## Instance Method Details

# (void) parseOperation(json)

Parses an operatio from the json format. It uses the specified parser in your OperationType module.

# (void) applyOpsBundle(ops_json)

Note: You must not use this method when you already have ops in your HB!

Apply a set of operations. E.g. the operations you received from another users HB.toJson().

# (void) applyOpsCheckDouble(ops_json)

Same as applyOps but operations that are already in the HB are not applied.

### See also:

- Engine.applyOps

# (void) applyOps(ops_json)

Apply a set of operations. (Helper for using applyOp on Arrays)

### See also:

- Engine.applyOp

# (void) applyOp(op_json)

Apply an operation that you received from another peer.

# (void) tryUnprocessed()

Call this method when you applied a new operation. It checks if operations that were previously not executable are now executable.

Quickly fuzzy find classes, mixins, methods, file:

- T Open fuzzy finder dialog

Control the navigation frame:

- L Toggle list view
- C Show class list
- I Show mixin list
- F Show file list
- M Show method list
- E Show extras list

You can focus and blur the search input:

- S Focus search input
- Esc Blur search input