# Class: IteratingSystem

A simple EntitySystem that iterates over each entity and calls processEntity for each entity every time the EntitySystem is updated. This is really just a convenience class as most systems iterate over a list of entities.

# Hierarchy

# Table of contents

# Constructors

# Properties

# Methods

# Constructors

# constructor

new IteratingSystem(family)

# Parameters

Name Type Description
family Family The family of entities iterated over in this System.

# Overrides

EntitySystem.constructor

# Defined in

src/systems/IteratingSystem.ts:18 (opens new window)

# Properties

# engine

Readonly engine: Engine

The engine of this system.

# Inherited from

EntitySystem.engine

# Defined in

src/core/AbstractSystem.ts:14 (opens new window)


# family

Readonly family: Family

The Family used when the system was created.

# Defined in

src/systems/IteratingSystem.ts:11 (opens new window)

# Methods

# getEntities

getEntities(): Entity[]

# Returns

Entity[]

A list of entities processed by the system.

# Defined in

src/systems/IteratingSystem.ts:36 (opens new window)


# getPriority

getPriority(): number

# Returns

number

The priority of the system. Do not override this!

# Inherited from

EntitySystem.getPriority

# Defined in

src/core/AbstractSystem.ts:75 (opens new window)


# isEnabled

isEnabled(): boolean

# Returns

boolean

True if the system is enabled.

# Inherited from

EntitySystem.isEnabled

# Defined in

src/core/AbstractSystem.ts:57 (opens new window)


# onDisable

Protected onDisable(): void

Called in two situations:

  • When the system is enabled and currently being removed from the manager
  • When the system is already added to the manager and is currently being disabled.

# Returns

void

# Overrides

EntitySystem.onDisable

# Defined in

src/systems/IteratingSystem.ts:27 (opens new window)


# onEnable

Protected onEnable(): void

Called in two situations:

  • When the system is enabled and currently being added to the manager
  • When the system is already added to the manager and is currently being enabled.

# Returns

void

# Overrides

EntitySystem.onEnable

# Defined in

src/systems/IteratingSystem.ts:23 (opens new window)


# processEntity

Protected Abstract processEntity(entity, deltaTime): void

This method is called on every entity on every update call of the EntitySystem. Override this to implement your system's specific processing.

# Parameters

Name Type Description
entity Entity The current Entity being processed.
deltaTime number The delta time between the last and current frame.

# Returns

void

# Defined in

src/systems/IteratingSystem.ts:47 (opens new window)


# setEnabled

setEnabled(enabled): void

Enable or disable the system. A disabled system will not be processed during an update.

# Parameters

Name Type Description
enabled boolean The new state.

# Returns

void

# Inherited from

EntitySystem.setEnabled

# Defined in

src/core/AbstractSystem.ts:43 (opens new window)


# setPriority

setPriority(priority): void

Set the system priority. You can set the priority with when adding the system as well.

# Parameters

Name Type Description
priority number The priority to execute this system with (lower means higher priority).

# Returns

void

# Inherited from

EntitySystem.setPriority

# Defined in

src/core/AbstractSystem.ts:66 (opens new window)


# update

update(deltaTime): void

The update method called every tick.

# Parameters

Name Type
deltaTime number

# Returns

void

# Overrides

EntitySystem.update

# Defined in

src/systems/IteratingSystem.ts:31 (opens new window)