# Class: IntervalIteratingSystem

A simple EntitySystem that processes a Family of entities not once per frame, but after a given interval. Entity processing logic should be placed in processEntity.

# Hierarchy

# Table of contents

# Constructors

# Properties

# Methods

# Constructors

# constructor

new IntervalIteratingSystem(family, interval)

# Parameters

Name Type Description
family Family Represents the collection of family the system should process.
interval number The time in seconds between calls to updateInterval.

# Overrides

IntervalSystem.constructor

# Defined in

src/systems/IntervalIteratingSystem.ts:19 (opens new window)

# Properties

# engine

Readonly engine: Engine

The engine of this system.

# Inherited from

IntervalSystem.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/IntervalIteratingSystem.ts:11 (opens new window)

# Methods

# getEntities

getEntities(): Entity[]

# Returns

Entity[]

A list of entities processed by the system.

# Defined in

src/systems/IntervalIteratingSystem.ts:41 (opens new window)


# getInterval

getInterval(): number

# Returns

number

The time in seconds between calls to updateInterval.

# Inherited from

IntervalSystem.getInterval

# Defined in

src/systems/IntervalSystem.ts:32 (opens new window)


# getPriority

getPriority(): number

# Returns

number

The priority of the system. Do not override this!

# Inherited from

IntervalSystem.getPriority

# Defined in

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


# isEnabled

isEnabled(): boolean

# Returns

boolean

True if the system is enabled.

# Inherited from

IntervalSystem.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

IntervalSystem.onDisable

# Defined in

src/systems/IntervalIteratingSystem.ts:28 (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

IntervalSystem.onEnable

# Defined in

src/systems/IntervalIteratingSystem.ts:24 (opens new window)


# processEntity

Protected Abstract processEntity(entity): void

The user should place the entity processing logic here.

# Parameters

Name Type Description
entity Entity The entity to be processed.

# Returns

void

# Defined in

src/systems/IntervalIteratingSystem.ts:50 (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

IntervalSystem.setEnabled

# Defined in

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


# setInterval

setInterval(interval): void

Update the interval.

# Parameters

Name Type Description
interval number The time in seconds between calls to updateInterval.

# Returns

void

# Inherited from

IntervalSystem.setInterval

# Defined in

src/systems/IntervalSystem.ts:25 (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

IntervalSystem.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

# Inherited from

IntervalSystem.update

# Defined in

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


# updateInterval

Protected updateInterval(): void

The processing logic of the system should be placed here. Will be called once every defined interval.

# Returns

void

# Overrides

IntervalSystem.updateInterval

# Defined in

src/systems/IntervalIteratingSystem.ts:32 (opens new window)