View Source API Reference ECSpanse v0.9.0

Modules

Ecspanse is an Entity Component System (ECS) framework for Elixir.

The Ecspanse.Command module provides a set of functions for managing entities, components and resources in the Ecspanse engine.

The Ecspanse.Component is the basic building block of the ECS architecture, holding the entity state. The components are defined by invoking use Ecspanse.Component in their module definition.

The Children component is a special component provided by the framework to maintain references to an entity's child entities.

A basic name component implemented by the library. While this component can be used by the game logic, it serves also for debugging purposes and as a way for third-party libraries to consistently identify entities.

The Parents component is a special component provided by the framework to maintain references to an entity's parent entities.

The Data module defines a struct that holds the state of the Ecspanse initialization process. This struct is passed to the setup/1 callback, which is used to define the running systems. After the initialization process the Data struct is not relevant anymore.

Entities are only identifiers. An entity exists only if it holds at least one component. The entities per se are not persisted.

Events act as a one-way communication channel to Ecspanse, enabling elements outside of the framework to dispatch data asynchronously into Ecspanse Systems. Events are also used internally to communicate between Systems. The events are defined by invoking use Ecspanse.Event in their module definition.

Special library event emitted upon a state change.

The frame is a struct that encapsulates the state of the current frame.

The Ecspanse.Projection behaviour is used to build state projections. The projections are defined by invoking use Ecspanse.Projection in their module definition.

The Ecspanse.Query module provides a set of functions for querying entities, components and resources.

Resources are global components that don't belong to any entity.

A special resource provided by the framework to check the FPS in real-time. The framework also provides a special system that updates the FPS resource. The TrackFPS system needs to be added to the Server, in order to calculate the FPS.

The server is responsible for managing the internal state of the framework, scheduling and running the Systems, and batching the Events.

The internal state of the framework.

The Ecspanse.State module is responsible for creating, storing and manipulating various application states. It provides functions for initializing the state, updating the state, and retrieving information from the state. As well as emitting special Ecspanse.Event.StateTransition events when the state changes.

The system implements the logic and behaviors of the application by manipulating the state of the components. The systems are defined by invoking use Ecspanse.System in their module definition.

Special framework system that creates default resources. Automatically runs only once on startup.

Generic system to be used by the Ecspanse.System.debug/0 in dev and test environments.

A special system provided by the framework that counts down the time for all the custom timer components.

A special system provided by the framework to track the FPS.

Systems that run only if specific events are triggered.

Systems that run every frame and do not depend on any event.

A template component is a generic way of defining the structure for related components. They share the same state fields and tags.

The Timer is a Template Component designed to facilitate the creation of custom timer (countdown) components.

A template event is a generic way of defining the structure for related events that share the same fields.

The Timer is a Template Event designed to facilitate the creation of custom timer (countdown) events.

This server is initiated upon application launch when operating in the test environment. This is done to allow tests to start their own custom servers and schedule custom systems.