The central object on which components, systems, etc. are added.

Worlds should be constructed using the World.build macro.

Constructor

new (componentLists:ComponentListMap, componentMaps:ComponentClassMap, systems:Vector<System>)

Construct a new world. Note: The World.create macro should be preferred.

Parameters:

components

The component lists for every kind of component.

systems

The systems that are processed.

Variables

delta:Float = 0

The number of seconds since the last time process was called.

This must be set manually so it can integrate with custom game loops.

read onlyentities:EntityManager

The entities contained in the World.

read onlysubscriptions:AspectSubscriptionManager

Subscriptions to entites.

Methods

inline createEntity ():Entity

Create an entity, with no components.

createEntityFromArchetype (archetype:Archetype):Entity

Create an entity, with components based on an Entity archetype.

dispose ():Void

Free resources used by this world.

getSystem<T> (cl:Class<T>):Null<T>

Get the system that is an instance of cl.

Parameters:

cl

The system class to retrieve the instance of.

Returns:

The system.

inline process ():Void

Process all active systems.

Static methods

staticbuild (setup:WorldConfiguration):World

Construct a new instance of World based on the WorldConfiguration given.

Parameters:

setup

The configuration to create the world with.

Returns:

The created world.