Skip to main content

Observer

Description:

  A record representing an observer of entity changes in the game systems.

Class Object: Observer Class.

watch

Type: Function.

Description:

  Watches the components changes to entities that match the observer's component filter.

Signature:

watch: function(self: Observer, func: function(Entity): boolean): Observer

Parameters:

ParameterTypeDescription
funcfunctionThe function to call when a change occurs. Returns true to stop watching.

Returns:

Return TypeDescription
ObserverThe same observer, for method chaining.