Module teraflop.ecs
Teraflop's Entity Component System primitives.
See Also
Entity Component System on Wikipedia
Functions
Name | Description |
---|---|
component(data, name)
|
Initialize a new Component optionally with initial data and a custom name.
|
tag(name)
|
Create a new Tag given a name.
|
Classes
Name | Description |
---|---|
Component
|
A container for specialized Entity data.
|
Entity
|
A world entity consisting of a unique ID and a collection of associated components. |
NamedComponent
|
A named container for specialized Entity data.
|
System
|
Derive this class to encapsulate a game System that operates on Resources and Components in the World. |
SystemException
|
Exception thrown on errors encountered in running System s.
|
Tag
|
A named, dataless Component used to flag Entities. |
World
|
A collection of Entities, their Component s, and Resource s. System s operate on those
components and mutate the World.
|
Structs
Name | Description |
---|---|
Diagnostic
|
Diagnostic generated by a running System .
|
Resources
|
A collection of Resource instances identified by their type. |
Manifest constants
Name | Type | Description |
---|---|---|
inheritsComponent
|
Detect whether T inherits from Component .
|
|
inheritsNamedComponent
|
Detect whether T inherits from NamedComponent .
|
|
inheritsSystem
|
Detect whether T inherits from System .
|
|
isCallableAsSystem
|
Detect whether T is callable as a System .
|
|
isComponent
|
Detect whether T is the Component class or inherits from Component .
|
|
isEntity
|
Detect whether T is the Entity class.
|
|
isNamedComponent
|
Detect whether T is the NamedComponent class or inherits from NamedComponent .
|
|
isResources
|
Detect whether T is the Resources struct.
|
|
isSystem
|
Detect whether T is the System class or inherits from System .
|
|
isWorld
|
Detect whether T is the World class.
|
|
storableAsComponent
|
Detect whether T may be stored as Component data.
|
Global variables
Name | Type | Description |
---|---|---|
Initialized
|
immutable(Tag)
|
Whether *all* of an Entity 's GPU Resources have been initialized.
|
Loaded
|
immutable(Tag)
|
Whether *all* of an Entity 's Asset Components have been loaded.
|
Aliases
Name | Type | Description |
---|---|---|
SystemGenerator
|
System function(World)
|
A function that initializes a new dynamically generated System .
|