classdesc

  Core singleton representing an instance of the Aurora engine. The engine is responsible for the creation (and registration) of entities, as well as initialization and running of systems containing game logic.

### Hierarchy

- Engine

## Index

### Constructors

- constructor

### Accessors

- assemblies
- entities
- lastTickTime
- onTickComplete
- onTickStart
- running
- systems

### Methods

- addAssembly
- addEntity
- addSystem
- getAssembly
- getEntity
- getSystem
- hasAssembly
- hasEntity
- hasSystem
- start
- stop
- tick

## Constructors

### constructor

- new Engine(): Engine

- - Defined in core/Engine.ts:22
  description

    Create an instance of the Aurora engine.

  #### Returns Engine

## Accessors

### assemblies

- get assemblies(): Entity[]

- - Defined in core/Engine.ts:53
  description

    Get all of the engine's assemblies.

  readonly

  #### Returns Entity[]

  - Array of assembly (entity) instances

### entities

- get entities(): Entity[]

- - Defined in core/Engine.ts:62
  description

    Get all of the engine's entities.

  readonly

  #### Returns Entity[]

  - Array of entity instances

### lastTickTime

- get lastTickTime(): number

- - Defined in core/Engine.ts:107
  description

    Get the timestamp of the engine's last tick.

  readonly

  #### Returns number

  - Timestamp in milliseconds

### onTickComplete

- get onTickComplete(): Function
- set onTickComplete(fn: Function): void

- - Defined in core/Engine.ts:71
  description

    Get the function currently set to execute after every tick.

  readonly

  #### Returns Function

  - Function currently set to execute
- - Defined in core/Engine.ts:115
  description

    Set a function to execute after every update tick.

  #### Parameters

  - ##### fn: Function

    Function to execute

  #### Returns void

  - Function currently set to execute

### onTickStart

- get onTickStart(): Function
- set onTickStart(fn: Function): void

- - Defined in core/Engine.ts:80
  description

    Get the function currently set to execute before every tick.

  readonly

  #### Returns Function

  - Function currently set to execute
- - Defined in core/Engine.ts:123
  description

    Set a function to execute before every update tick.

  #### Parameters

  - ##### fn: Function

    Function to execute

  #### Returns void

  - Function currently set to execute

### running

- get running(): boolean

- - Defined in core/Engine.ts:89
  description

    Get whether or not the engine is currently running.

  readonly

  #### Returns boolean

  - True if the engine is running

### systems

- get systems(): System[]

- - Defined in core/Engine.ts:98
  description

    Get all of the engine's systems.

  readonly

  #### Returns System[]

  - Array of system instances

## Methods

### addAssembly

- addAssembly(assembly: Entity): Entity[]

- - Defined in core/Engine.ts:132
  description

    Add an assembly (entity) instance to the engine.

  #### Parameters

  - ##### assembly: Entity

    Assembly instance

  #### Returns Entity[]

  - Array of assembly (entity) instances

### addEntity

- addEntity(entity: Entity): Entity[]

- - Defined in core/Engine.ts:154
  description

    Add an entity instance to the engine. This will check which systems should watch it, and add it to those systems (running the entity through each system's onAdd hook. After being added and initialized, entities are immutable (although their component data is not).

  #### Parameters

  - ##### entity: Entity

    Entity instance

  #### Returns Entity[]

  - Array of entity instances

### addSystem

- addSystem(system: System): System[]

- - Defined in core/Engine.ts:182
  description

    Add a system instance to the engine. This will run the system's onInit hook. After being added and initialized, systems are immutable and are updated every game tick.

  #### Parameters

  - ##### system: System

    System instance

  #### Returns System[]

  - Array of system instances

### getAssembly

- getAssembly(type: string): Entity

- - Defined in core/Engine.ts:205
  description

    Get an assembly (entity) instance by type from the engine.

  readonly

  #### Parameters

  - ##### type: string

    Assembly type

  #### Returns Entity

  - Requested assembly (entity) instance

### getEntity

- getEntity(uuid: string): Entity

- - Defined in core/Engine.ts:218
  description

    Get an entity instance by UUID from the engine.

  readonly

  #### Parameters

  - ##### uuid: string

    Entity UUID

  #### Returns Entity

  - Requested entity instance

### getSystem

- getSystem(name: string): System

- - Defined in core/Engine.ts:231
  description

    Get a system instance by name from the engine.

  readonly

  #### Parameters

  - ##### name: string

    System name

  #### Returns System

  - Requested system instance

### hasAssembly

- hasAssembly(type: string): boolean

- - Defined in core/Engine.ts:244
  description

    Check if an assembly is present within the engine.

  readonly

  #### Parameters

  - ##### type: string

  #### Returns boolean

  - True if the assembly is present

### hasEntity

- hasEntity(uuid: string): boolean

- - Defined in core/Engine.ts:254
  description

    Check if a system is present within the engine.

  readonly

  #### Parameters

  - ##### uuid: string

  #### Returns boolean

  - True if the entity is present

### hasSystem

- hasSystem(name: string): boolean

- - Defined in core/Engine.ts:264
  description

    Check if a system is present within the engine.

  readonly

  #### Parameters

  - ##### name: string

    System name

  #### Returns boolean

  - True if the system is present

### start

- start(): void

- - Defined in core/Engine.ts:271
  description

    Start the execution of the update loop.

  #### Returns void

### stop

- stop(): void

- - Defined in core/Engine.ts:284
  description

    Stop the execution of the update loop.

  #### Returns void

### Private tick

- tick(): void

- - Defined in core/Engine.ts:292
  description

    Perform one tick and update all systems.

  #### Returns void

Generated using TypeDoc